Displaying 20 results from an estimated 3000 matches similar to: "using alpha transparency for lines in levelplot"
2007 Oct 23
1
Custom colourkey spacing in levelplot, contourplot
Dear R gurus,
I have got stuck on how to customise the colorkey generated by
levelplot and contourplot, in the lattice package. This best
illustrated by an example:
library(lattice)
levelplot(volcano^20/1e45,at=c(0,0.001,0.01,0.1,1,10))
The reason for raising the volcano dataset to the 20th power is to
create a dataset with a large vertical exaggeration - this is similar
in nature to the data
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
2006 May 10
4
lattice package plots
I am using the lattice packge for its levelplot and contourplot. Is it
possible to adjust the line thickness of the 'box' and tickmarks in these
plots?
Thanks for the attention,
Matt Sundling
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
2005 Oct 11
1
problems with levelplot and contourplot
Hello,
Using the following code i want to make a level or contourplot of some
data that I produced
library(grid);library(lattice);
mydata <- read.table("avgee.dat");
mymat <- as.matrix(mydata);
mymat <-t(mymat)
vals<-as.vector(mymat);
conc<-c(0.0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5);
a<- c(0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5,5.0,
7.5,10,
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
2011 Nov 15
1
equal spacing of the polygons in levelplot key (lattice)
Given the example:
R> (levs <- quantile(volcano,c(0,0.1,0.5,0.9,0.99,1)))
0% 10% 50% 90% 99% 100%
94 100 124 170 189 195
R> levelplot(volcano,at=levs)
How can I make the key categorical with the size of the divisions equally spaced in the key? E.g., five equal size rectangles with labels at levs c(100,124,170,189,195)?
Apologies if this is obvious.
-A
R> version
2004 Aug 06
1
: (Lattice): Overlaying more than one trend surface using contourplot() and wireframe()
Hi,
Is there a way to plot more than one trend surface using the functions
contourplot() and wireframe(). I have found an add=T in contour(), but
no equivalent argument in contourplot() and wireframe()?
I have taken the example 11-2 (pages 441-451) from Design and analysis
of experiments (Montgomery 2001, 5th edition) to see if this could be
done in R. I have managed to plot individual
2011 Jul 28
0
lattiace bug with levelplot borders
Hi,
I would like to report a problem with the levelplot borders in lattice.
Description:
The borders in levelplots appear when running in a Windows setting, however running the identical command in Linux does not generate the plot with the borders.
The commands used were:
library(lattice)
levelplot(volcano, border = 'black', shrink = c(0.7, 0.7));
The same version of R (2.13.0) and
2010 Aug 14
1
How to add lines to lattice plot produced by rms::bplot
I have a plot produced by function bplot (package = rms) that is
really a lattice plot (class="trellis"). It is similar to this plot
produced by a very minor modification of the first example on the
bplot help page:
requiere(rms)
n <- 1000 # define sample size
set.seed(17) # so can reproduce the results
age <- rnorm(n, 50, 10)
blood.pressure <- rnorm(n, 120,
2011 Sep 30
1
need help with contourplot figure
I can't figure out how to add tick marks on both my X and Y axis. For example, my X axis ranges from 0 to 1 and there are both a tick mark and a number label at the X-axis values of 0.2,0.4,0.6. and 0.8. I want to add tick marks to the figure at every 0.1 value. This will help a viewer determine the values on the x axis.
I included all of my code. I apologize but it is very long. I am
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,
2010 Dec 27
1
aperm() should retain class of input object
aperm() was designed for multidimensional arrays, but is also useful for
table objects, particularly
with the lattice, vcd and vcdExtra packages. But aperm() was designed
and implemented before other
related object classes were conceived, and I propose a small tune-up to
make it more generally useful.
The problem is that aperm() always returns an object of class 'array',
which
2004 Feb 25
2
levelplot add line
R folks,
I can't seem to find the instructions in the help files for the lattice
package that explain how to add lines, such as with lines() or ?, to a
levelplot. I'd be grateful if someone could point me in the proper direction.
Cheers,
Jeff
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jeff Jorgensen
Center for Limnology jcjorgensen at wisc.edu
2009 Mar 15
1
Contour plots of four two-dimensional matrices
I have four large two-dimensional matrices of which I want to create contour
plots. Something like
filled.contour(<matrix>)
contourplot(<matrix>)
works but only gives me one plot at a time. If I combine the four matrices
into one three-dimensional matrix, which I'll name "seven", there should be
a way of doing something like this
contourplot(seven[,,k] for k in 1 to 4)
2008 Nov 24
2
lattice contourplot background covers inward-facing ticks
I wish to have inward-pointing ticks on my contourplot graph, but the
colored background produced by the "region=TRUE" statement covers the
ticks up, is there any way around this? Sample code below. --Seth
library(lattice)
model <- function(a,b,c,d,e, f, X1,X2) # provide model function
for contour plot
{J <- a + (b*X1) + (c*X2) + (d*X1*X2) + e*(X1^2) + f*(X2^2)
pp
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):
2010 Sep 27
1
smooth contour lines
Is there an easy way to control smoothness of the contour lines?
In the plot I am working on due to the undersampling the contour
lines I am getting are jugged, but it is clear "by eye" these should
be basically straight lines.
In maps package I found smooth.map function, but maybe there is a more
generic way
of accomplishing the same thing.
Ideally there would be an option to control
2009 May 05
2
Lattice: use levelplot as panel for wireframe
Hi,
I want to draw a figure similar to http://dsarkar.fhcrc.org/lattice/book/images/Figure_13_07_stdBW.png
from http://lmdvr.r-forge.r-project.org/figures/figures.html (figure
13.7) . However instead of using a contour plot as a panel for the
wireframe I want to use a levelplot. Can somebody help me with this?
Thanks in advance for any help,
Kind regards,
Anton Bossenbroek
2010 Dec 20
1
contourplot help
Hello
I'm using the following call to create a contourplot:
library(lattice)
m <- as.matrix(read.table("data.txt"))
contourplot(m[,3] ~ m[,2] * -m[,1],
at = c(1e-6, 1e-5, 1e-4, 1e-3, 1e-2, 1e-1),
scales = list(x = list(log = 10,
labels = c("1", "10", "100"),