Displaying 20 results from an estimated 6000 matches similar to: "Lattice: Drawing a single contour line with a negative value fails"
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
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
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 Feb 10
1
the proper way to use panel functions in lattice package?
Hi,
I was trying to stack a topographic map readed in from esri shapefile with a
contour map and a vector map. However, the plotMap(maptools) and
contourplot(lattice) do not seem to work well on top of each other. Here is
part of my code.
xrange<-range(225000:350000)
yrange<-range(2685000:2810000)
basemap <- read.shape("Twn25_town_dxf_Polygon.shp")
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
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
2012 Feb 09
2
Lattice 3d coordinate transformation
Hello List!
I asked this before (with no solution), but maybe this time... I'm
trying to project a surface to the XY under a 3d cloud using lattice.
I can project contour lines following the code for fig 13.7 in
Deepayan Sarkar's "Lattice, Multivariate Data Visualization with R",
but it fails when I try to "color them in" using panel.levelplot.
?utilities.3d says there
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
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)
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)
2002 Oct 10
1
contour in lattice
Hi
I'm using lattice's function levelplot but when I choose the flag
contour =TRUE I get very strange results. It looks like the contour
lines have nothing to do with the "image" plot under ...
Is there some known problem with this function ?
Regards
EJ
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read
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
2011 May 23
3
Get contour of a map
Hello everybody,
I search a function which returns the contour of map with levels like contourLines, but I would like this function return the border of the map too, because the function contourLines cannot consider the corner of the map and it is not adapted to fill polygon after that.
Thanks in advance
Pierre Bruyer
2009 Jan 06
3
smoothed contour lines
Hi all,
I'm trying to draw a contour plot
with rounded (smoothed) contour lines instead of sharp angles;
when the grid consists of only a few points
in x- and y- axis, the resulting contour
is in facts rather ugly since very sharp angles may appear.
I did not find any way to do it,
by using either "contour" or "contourplot" (from the lattice package),
I wonder if there
2010 Mar 23
1
filled.contour formatting questions
Hello, I'm having some trouble getting things to look as I want with
filled.contour.
1. My first issue is that I am unable to add line segments to my plot where
I want them. Using the rug pattern example:
x <- y <- seq(-4*pi, 4*pi, len = 27);
r <- sqrt(outer(x^2, y^2, "+"));
filled.contour(cos(r^2)*exp(-r/(2*pi)));
segments(0.2,0.2,1,0.2);
The line segment is not found in
2006 Jan 09
1
How to use filled.contour(x,y,z) data for levelplot(z)?
Dear all,
We used the following function to create a spatial plot of a raster image:
filled.contour(xx,yy,zz, color = terrain.colors, nlevels=10,
main=naamjaar, plot.axes = { contour(Xcoord/1000,Ycoord/1000,lim.data,
nlevels = 4, col=4,drawlabels = T, axes = FALSE, frame.plot = FFALSE,
add = TRUE);axis(1); axis(2);
2009 Oct 22
1
contour() & contourLines()
Hi Folks,
I have been using contour() to produce some contour plots
(of a spatially-smooted density produced by kde2d()), with
very satisfactory results.
I now want access to the coordinates of the points on the
contours, and it would seem that contour() does not return a
value, so there is nothing from which these could be extracted.
However, apparently contourLines() does, and it seems to be
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
2010 Oct 24
6
Contour Plot on a non Rectangular Grid
Dear All,
I would like to plot a scalar (e.g. a temperature) on a non-rectangular
domain (or even better: I would simply like to be able to draw a contour
plot on an arbitrary 2D domain). I wonder if there is any tool to
achieve that with R. I did some online search in particular on the list
archives, found several queries similar to this one but was not able to
find any conclusive answer.
I