Displaying 20 results from an estimated 10000 matches similar to: "question about image command"
2005 Apr 20
1
overlaying a contour line in a levelplot
Hello there,
I am creating a series of images using levelplot but I also want to
overlay a contour for a particular value as reference. Here is the
levelplot command for the image:
print(levelplot(d~x+y,data=t,cuts=20,scales=list(draw=F),xlab=NULL,ylab=
NULL,col.regions=heat.colors(100)[100:1]),split=c(1,1,1,1),more=T)
and then to add the contour plot (I only want a contour at level 5):
2007 Jul 24
3
Overlaying a single contour from a new data array in levelplot
Dear R-Help community,
I am trying to overlay a single contour line over a correlation plot using
levelplot in the lattice package. These are the two arrays:
1) a correlation plot over Africa - so each grid square is a different colour
dependent on correlation - this is in an array: result_cor with dim[465,465]
2) a single contour line from a ***different data source*** - this is from data
2003 Jun 13
1
Lattice levelplots and (partial) failure on some devices ----Long
Dear Community,
(win XP home, sp1; R1.7 -- patched version, binary download, version of
lattice obtained with patched version; the following applies to 1.6.2 as
well.)
The following message was originally composed to seek help. However I
have 'hacked' a solution to the following behavior, but none the less
someone might find this interesting.
To reproduce my 'problem' you
2007 Mar 26
1
using alpha transparency for lines in levelplot
Hello, I'm having trouble with using the alpha channel for transparency
with lines with lattice levelplots.
If I use transparency via the alpha argument to rgb to overplot lines on
levelplot the transparent colour affects all of the region colours in the
plot.
Can anyone explain why the difference in region colours?
#### Warning: this code attempts to create PDF files in working
directory
2010 Nov 23
6
Filled contour plot showing labeled isolines?
Is it possible to create a contour plot with the isolines labeled. I know
you can do this with Matlab. Argh!
I tried creating a filled contour plot, then using par(new=T), followed by
overlaying the contour plot on top. However, the placement of the filled
contour plot and the contour plot do not align correctly. Any suggestions
would be appreciated.
Thanks,
Jon
--
View this message in
2007 Mar 25
1
controlling panel.width and panel.height in viewports
Dear all,
I'm trying to get a series of lattice levelplots to appear in
viewports in a particular way but struggling to exert fine control
over their appearence. There are two conditions: (a) I only want the
levelplot to appear (I don't want axes, colour key, etc) in the
viewport and (b) I want the levelplot to expand to the maximum
allowable space in the viewport while observing
2004 Aug 31
1
add single contour line to levelplot
Hello,
I want to add a single contour line to a levelplot but can't figure out
how to do it 'on-the-fly'. When I include the last line in the code below,
I get the following error:
Error in NextMethod("[") : Argument "subscripts" is missing, with no default
Any tips on how to fix this are greatly appreciated!
Ian Jonsen
2011 Dec 31
2
How to color a region in a contour plot with the contour being the boundary?
Dear expeRts,
I would like to color a certain region in a levelplot. The region for z <= 0.02 should have a dark gray color. Below is a minimal example. It almost does what I want, but The region between z=0.02 and z=1 is also colored in dark gray (instead of just the region for z <= 0.02).
How can I solve this?
Cheers,
Marius
## z values for given x and y
f <- function(x)
2003 Nov 12
2
question about matrix
Hello,
I have a few questions about matrix in R.
Can we make a matrix whose elements are list? I would like to save two
different values in each elements of matrix. If there is a package or
something which can deal with complex numbers, that will do it too. Also,
I am wondering whether there is a function to calculate the rank of the
matrix. I found a matrix package, but it doesn't have
2007 Oct 12
3
Anybody has ever met the problem to add a legend to a figure generated by image()?
Dear friends,
Anybody has ever met the problem to add a legend to a figure generated by
image()? I have three variables,x,y and z.
x and y are the coordinates, and z is the third values. we can use image(x,
y, z,...) to generate a figure according to the z-values, but the problem is
the figure legend. How can the legend be added to a figure generated
by image()? Note that filled.contour() can
2006 Feb 12
1
contour lines for levelplot
Hi,
I would like to add contour lines to a (trellis/lattice-) levelplot.
Sure, there is the "contour=TRUE" argument, but this uses
"cuts=..." (which is usually chosen very high for my plots. I guess
cuts=99 is the best you can do (?)) for plotting the contour lines.
Furthermore, I do not like the numbering of the contour lines this
way. Therefore, I tried to add a
2005 Apr 07
3
4D Plot ??
Tried to post this last night, but it doesn't seem to have appeared.
Using R 2.0.1 on Windows XP + SP2.
I am traveling, away from my usual references. I'm trying to make a
4-dimensional plot: a levelplot with overlaid contours, with different
response variables represented by (1) colors on the levelplot and (2)
the contour lines.
First try was filled.contour + contour but the key
2005 May 06
2
plotting image/contour on irregular grid
Hello,
I'd like to make a z(x,y) plot for irregularly spaced
x,y. What are routines are available in R for this
purpose?
Thanks,
Mark
2008 Jan 18
3
Problems with lattice plot
Hello useRs,
I have some problems when I try to plot a lattice. The lattice has 200
columns (X value) and 5 rows (Y value), with a total of 1000 squares. I
want to plot this lattice with the squares having different colours
according to a variable value.
The variable I want to plot is cover value of a shrub, and it has values
between 0 and 1. I want to plot the squares with value 1,
2009 Aug 19
1
Lattice: Drawing a single contour line with a negative value fails
Hi everybody,
I want to add a single contourline to a levelplot. While everything
works fine if the value at which the line should be drawn is positive,
there is an error if the value is negative:
library(lattice)
my.panel <- function(..., at, contour=FALSE, labels=NULL) {
panel.levelplot(..., at=at, contour=contour, labels=labels)
panel.contourplot(..., contour=TRUE,
2002 Sep 23
4
How do I change plot colors in bwplot
Hello,
I'm using bwplot to make a few plots. The plots are exactly what I
need, but are coming out with a grey background and turquoise boxes and
whiskers. I cannot figure out how to just get black and white to be
the default. Can anyone help me with this?
Thanks
Kenneth E. Nussear Phone 775 784-1703
Ecology, Evolution and FAX 775 784-1369
2007 Nov 26
2
2d Joint Density Plot
Hi all,
I'm fairly new to R, so I'm still trying to feel out what is available to
me. I would like to be able to plot joint density in a two dimensional plot
where density is indicated by color or darkness gradients, like a 2d color
coded topographic map. Ideally, the output would be something I could then
plot other points or lines on.
Currently, I'm calculating joint density with
2004 Jun 07
1
contour lines on levelplot?
With "image" and "contour", one can get both colors and lines to
enhance the image of a contour plot. What's the best way to do this
with Lattice graphics? The following is one ugly hack, producing the
desired result after much trial and error (R 1.9.1 alpha under Windows
2000):
# setup
DF <- expand.grid(x=1:3, y=1:3)
DF$z <- (DF$x+DF$y)
# Traditional
2012 May 29
1
lattice: add a marginal histogram on top of the colorkey of a levelplot?
Lattice experts:
Can you think of a way to produce a levelplot as below and then add a histogram of the z variable to the top margin of the plot that would sit on top of the color key?
x <- seq(pi/4, 5 * pi, length.out = 100)
y <- seq(pi/4, 5 * pi, length.out = 100)
r <- as.vector(sqrt(outer(x^2, y^2, "+")))
grid <- expand.grid(x=x, y=y)
grid$z <- cos(r^2) *
2001 Nov 12
1
Filled Contour.
Hi.
I'm a big user of level plots. Because filled.contour() didn't do exactly
what I wanted, I hacked at it a bit to add these options:
(*) Even spacing in the key, even if the contours are not evenly spaced.
(*) Horizontal key
(*) options to not use layout() and to plot only the level plot _or_
only the key. This means you can use layout yourself to (e.g.)
have several