Displaying 20 results from an estimated 9000 matches similar to: "Add grid lines to levelplot"
2011 Dec 22
2
Indexing multi-dimensional table
I want to take slices of a multi-dimensional table (or array) without
knowing the number of dimensions in advance.
As a test I tried using (in this example a 3d table):
do.call(`[`, list(tbl, x,NULL,NULL)]
where I built the list on the fly. It works great as long as I only want the
first dimension however when I try a different dimension, say with
list(tbl,NULL,x,NULL), I get
2009 May 10
2
Unintended loading of package:datasets
The dataset package is being loaded apparently by one of the packages that I
am using. The loading of the datasets takes a long time and I would like to
eliminate it. I thought the datasets were effectively examples so don't
understand why they would be required at all.
1) How can I determine what is causing the datasets to be loaded?
2) How can I stop them from doing so?
I am using the
2004 Dec 16
2
Unsightly lines from x*y grid in levelplot with Postscript
When I generate levelplot figures with Postscript, the lines from
the underlying grid (i.e., the x and y in z ~ x* y)
show up as faint white lines in the output. If I have a dense grid,
the lines wash out the contour colors. I can avoid the problem if
I use png instead, but that brings up other problems. Any
ideas for how I can get Postscript to not show those lines around
the cells?
Scott
2005 Mar 30
1
help with plotting a grid on levelplot
I'm trying to plot a grid over a levelplot
print( levelplot( var1.pred~x+y,
data=saw.pred,
aspect=mapasp(saw.pred),
col.regions=terrain.colors(80),
main=main) )
using the data...
> saw.pred
x y var1.pred var1.var sort
1 5 5 3.3761200 256.3363 saw
2 15 5 3.3884142 499.5695 saw
3 25 5 3.5394769
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
2006 Mar 04
5
Remove "gray grid" from levelplot
Hi,
If I use the levelplot function of the lattice library, I always see
small "squares" in the plot. They indicate the region for which the
same color is used. If you have a levelplot of a function which is
evaluated at 25x25 equally-spaced points you obtain 26 squares in x
and 26 squares in y direction. That does not bother too much (but
still bothers somehow...), but if 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
2011 Sep 28
0
Package lattice: levelplot for matrix method produces images with blank lines ...
Dear R-users,
I am trying to produce a levelplot of a matrix of values (430x430) using "levelplot" from lattice package. My problem is that I am not able to obtain an image without blank/white lines in some rows and columns (a continuous image). Attached are two png files (different resolution) showing the problem.
Is it possible to obtain "continuous images" as with the
2008 Oct 17
1
padding "bug" in lattice/levelplot
Hello,
I have encountered some unexpected behaviour with levelplot that may
simply be a misunderstanding on my part.
If I create a levelplot from a matrix with named columns, some
"padding" space appears at the top and bottom of the heatmap. Here is
an example, and I've used panel.fill to make the space I'm speaking of
evident (in green).
2006 Jun 13
2
levelplot and source() problems
I have been using levelplot but have had trouble calling it inside
functions - something seems to go wrong when it's not called directly from
the R command prompt. Simplest reproducible example:
$ R --vanilla
> library(lattice)
> levelplot(matrix(1:4,2,2))
- This gives a nice plot in soothing pastel colors.
Now, with a file lptest.r containing 2 lines:
library(lattice)
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
2006 Sep 13
1
forcing levelplot to use relative cuts (ie cuts for each panel)
Dear guRus,
I'm having trouble producing a levelplot with relative cuts for each
panel (my data has large differences in scales, so I want to use
quantiles for each panel).
My attempts to change the 'at' argument in panel.levelplot function
have not met with success.
Below is a toy example.
xy <- expand.grid(x = 1:3, y = 1:3)
aaa <- rbind(cbind(xy, z = 1:9, site =
2013 Feb 20
1
Problem with levelplot() in a loop
Dear R users,
I am trying to print heatmaps in a loop (with a pause). Idea is to
visualize changing correlations over time and for testing I wrote this
simple (reproducible) code below.
My problem is that levelplot() does not produce any output when I run the
code (though heatmap does). Ideally I would like to use levelplot() as it
produces a neat index on the side indicating the color and the
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):
2009 Nov 09
1
How to change color the default in levelplot() ?
Dear R communities
May I seek your advices on how to change color the default in levelplot(), e.g. from the default of pink and light blue, to e.g. red and green ?
The levelplot function has 1 of the arguments being panel (which is actually panel.levelplot), but I am not sure where the commands to alter the color.
For example, I type:
p1<-levelplot(my.mat,colorkey=FALSE),
how could I
2004 Apr 27
1
helps on levelplot
I'm a new user of levelplot, and are not familiar with the terminology
very well. Is the bar alongside the levelplot indicating color or shade
call "colorkey"? I have to adjust the size of its label, but couldn't
make it so far. This is how I did:
levelplot(z~x*y, grid, at=seq(0,1,by=0.1),
colorkey=list(labels=list(cex=2)))
But I got error message "Error in
2007 Jun 27
1
levelplot in lattice
Hi,
I'm new to lattice. So please kindly be patient with me.
I'm trying to arrange groups of levelplots into 3 rows as follows:
Row1: Probabilities as functions of x and y, and conditioned on an event factor vector factor("a","b","c")
Row2: Number of days as functions of x and y, and conditioned on, again the same event
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
2010 Jan 09
0
[Lattice] panel.levelplot - shrink argument to highlight absolute z-values
Hi -
I have a levelplot with positive and negative z-values. I'd like
to scale the levelplot rectangles proportional to the *absolute*
z-values to highlight the z-value extremes (while retaining the color
difference to track the positive/negative attribute). I've likely
missed something in the documentation, but have been at it a couple
days without finding a solution (other than
2003 Dec 22
0
(PR#6005) Re: [R] lattice: levelplot: error: min not meaningful
Actually, this is supposed to work (and is given as an example in my DSC-2003
paper), and at some point, did. It seems this was broken as a consequence of
a careless change in panel.levelplot. The first 5 lines should have been
label.style <- match.arg(label.style)
x <- as.numeric(x[subscripts])
y <- as.numeric(y[subscripts])
minXwid <- min(diff(sort(unique(x))))