Re: [R] Contour plots in R Studio

2014-05-12 Thread Pascal Oettli
Hi Lydia, Your question match more the topics of the r-sig-geo list. Please have a look at the "raster" package, as well as the "rasterVis" package to read and work with NetCDF format. Regards, Pascal On Tue, May 13, 2014 at 6:27 AM, Lydia Keppler wrote: > Hi all, > > I am using Windows 7 and

Re: [R] Contour plots in R Studio

2014-05-12 Thread Jeff Newmiller
Granted, you are new here, but reading the Posting Guide is advice included in every post on this list. One key recommendation found there is to not post in HTML, as we don't see what you see when you do that. Use plain text email. Another key piece of advice in the Posting Guide is to provide a

Re: [R] Contour plots in R Studio

2014-05-12 Thread Bert Gunter
Well one would expect that you might find something useful by searching the obvious, like ?contourplot and following the links therein. It also seems (to me, anyway) that you have made little effort to understand how R works, its data structures, syntax, and so forth. So please peruse "An Introd

[R] Contour plots in R Studio

2014-05-12 Thread Lydia Keppler
Hi all, I am using Windows 7 and R Studio version 3.0.2 (2013-09-25). I am relatively new to R and am trying to make a contour plot from a 3D data grid. I my data file has the following specifics: [1] "file Data.nc has 3 dimensions:" [1] "time Size: 96" [1] "lat Size: 21" [1] "lon Size: 61

Re: [R] contour plot axis correspondence

2013-11-16 Thread William Dunlap
[mailto:r-help-boun...@r-project.org] On > Behalf > Of ivo welch > Sent: Saturday, November 16, 2013 11:40 AM > To: r-help > Subject: [R] contour plot axis correspondence > > I am struggling with a contour plot. I want to place a cross over the > minimum. alas, I don&#x

[R] contour plot axis correspondence

2013-11-16 Thread ivo welch
I am struggling with a contour plot. I want to place a cross over the minimum. alas, I don't seem to be able to map axes appropriately. here is what I mean: N <- 1000 rm <- rnorm(N, mean=0.0, sd=0.4) rx <- rnorm(N, mean=0.0, sd=0.4) rt <- rnorm(N, mean=0.0, sd=0.4) exploss <- function(hdgM,hdg

Re: [R] Contour lines in a persp plot

2013-05-17 Thread Matthew
Thanks a lot, that is all i want. If someone is interessed, see the code below panel.3d.contour <- function(x, y, z, rot.mat, distance, nlevels = 20, zlim.scaled, ...) # les3 points de suspension pour dire les autres paramètres sont ceux données par défaut { add.line <- trel

Re: [R] Contour lines in a persp plot

2013-05-16 Thread David Winsemius
On May 16, 2013, at 8:23 AM, sms...@univ-fcomte.fr wrote: > Hello folks, > > i'm a R beginner and i want to put in a same plot both contour lines and > persp plot. > > For example, > > fn<-function(x,y){sin(x)+2*y} #this looks like a corrugated tin roof > > x<-seq(from=1,to=100,by=1) #genera

[R] Contour lines in a persp plot

2013-05-16 Thread smsome
Hello folks, i'm a R beginner and i want to put in a same plot both contour lines and persp plot. For example, fn<-function(x,y){sin(x)+2*y} #this looks like a corrugated tin roof x<-seq(from=1,to=100,by=1) #generates a list of x values to sample y<-seq(from=1,to=100,by=1) #generates a list

Re: [R] contour plot help

2012-10-10 Thread David Winsemius
On Oct 10, 2012, at 7:58 AM, namrata mohapatra wrote: > Hello > > I am interested to plot a contour plot using the colour : rainbow , however I > want to reverse the order of the colour ( such that red represents max value > and blue min value) and also remove the lines in white in the plot .

[R] contour line labels in trellis contourplot

2012-07-21 Thread Martin Ivanov
Hello, In the classical function "contour" labels are drawn so that each contour line is broken at the place of the label, so that the label does not overlap the line. In the trellis contoourplot the labels are placed beside or over the line, controlled by the label.style parameter, but I could

Re: [R] Contour

2012-07-19 Thread Jean V Adams
As Duncan Murdoch pointed out, the example data frame that you provided doesn't give very interesting results (all the shock values are zero), so I created a different shock variable for illustration. I suggest using the interp() function in the R package akima. df <- structure(list(c = 1:6, z

Re: [R] Contour

2012-07-19 Thread Duncan Murdoch
On 12-07-19 2:01 AM, Akhil dua wrote: Hello every one can any one tell me how to draw contour with this data set c zshock 1 0.45450237 0 2 0.02663337 0 3 -2.08444556 0 4 -0.12715275 0 5 0.67066360 0 6 -0.73540081 0 I want to dr

[R] Contour

2012-07-18 Thread Akhil dua
Hello every one can any one tell me how to draw contour with this data set c zshock 1 0.45450237 0 2 0.02663337 0 3 -2.08444556 0 4 -0.12715275 0 5 0.67066360 0 6 -0.73540081 0 I want to draw contour for shock i.e my z matrix is shock

[R] contour lines with number labels in lattice?

2012-07-18 Thread Martin Ivanov
Dear R users, I am new to lattice but am trying to get to grips with it. I need to add contour lines for the topography to a plot I created with spplot. The topography is available as a SpatialPixelsDataFrame object Z_sfc. If I plot it as spatial lines, after converting to a SpatialLines objec

Re: [R] contour

2012-07-18 Thread Rui Barradas
Hello, Now I don't understand. Inline Em 18-07-2012 11:56, Akhil dua escreveu: why are you writing ncol=2 ? I have levels=100 for x1 and the x1 is my z matrix In your contour instruction x3 is the z matrix, not x1. And your dataset shows a 2x3 grid, hence ncol=2, for (x1 times x2) 0:1x1:3.

Re: [R] contour

2012-07-18 Thread Eik Vettorazzi
Hi Akhil, in addition to Rui's post, here is a solution using lattice graphics. tmp<-read.table(textConnection("x1 x2 x3 0 12 0 21 0 35 1 14 1 22 1 33"),header=T) library(lattice) contourplot(x3~x1*x2,tmp) hth. Am 18.07.2012 11:23, schrieb Akhil dua: > Hello

Re: [R] contour

2012-07-18 Thread Rui Barradas
Hello, Follow the code below and see what's the right way: d <- read.table(text=" x1 x2 x3 0 12 0 21 0 35 1 14 1 22 1 33 ", header=TRUE) x3 <- matrix(d[, "x3"], ncol=2) levels <- sort(unique(x3)) contour(0:1, 1:3, t(x3), levels=levels) Hope this helps, Ru

[R] contour

2012-07-18 Thread Akhil dua
Hello Everyone I have the data long format and I want to draw the contour plot with it x1 x2 x3 0 12 0 21 0 35 1 14 1 22 1 33 when I am using contour(x1,x2,x3,col=heat.colors) or fill.contour its giving me an error that increasing x and y expected So please

[R] Contour lines within a spplot

2012-05-11 Thread Nicola Cortesi
Hi all, As you know, spplot function of sp package is very powerful and even allows to superimpose contour lines with the option 'contour=TRUE'. The color of the contour line can be changed with the 'col' option. I'd like to know if it possible to improve on this: 1) changing the color of the

Re: [R] contour algorithm

2012-04-22 Thread Duncan Murdoch
On 12-04-21 9:21 PM, Stoch astic wrote: First time user, so sorry if I don't understand protocol.. Anyway, I have created a data frame consisting of pearson's R values at various x and y coordinates and then plotted this using filled.contour. My data is similar to fMRI data except that it is a su

Re: [R] contour algorithm

2012-04-21 Thread R. Michael Weylandt
The C implementation of the algorithm is here: http://svn.r-project.org/R/trunk/src/main/plot3d.c (grep filledcontour) but I don't see a reference other than to Ross Ihaka. Hope this helps, Michael On Sat, Apr 21, 2012 at 9:21 PM, Stoch astic wrote: > First time user, so sorry if I don't under

[R] contour algorithm

2012-04-21 Thread Stoch astic
First time user, so sorry if I don't understand protocol.. Anyway, I have created a data frame consisting of pearson's R values at various x and y coordinates and then plotted this using filled.contour. My data is similar to fMRI data except that it is a surface map reconstructed from histological

Re: [R] contour for plotting confidence interval on scatter plot of bivariate normal distribution

2012-03-03 Thread David Winsemius
I do agree with the recommendation to consider car::dataEllipse() for plotting a best fit for the theoretical bivariate Normal situation. However, the bagplot function from Has Peter Wold: http://www.wiwi.uni-bielefeld.de/~wolf/#software is more likely to "line up" and be suitable for drawi

Re: [R] contour for plotting confidence interval on scatter plot of bivariate normal distribution

2012-03-03 Thread Michael Friendly
On 3/3/2012 12:34 PM, drflxms wrote: Thanx a lot Greg for the hint and letting me not alone with this! Tried ellipse and it works well. But I am looking for something more precise. The ellipse fits the real border to the nearest possible ellipse. I want the "real" contour, if possible. The 'co

Re: [R] contour for plotting confidence interval on scatter plot of bivariate normal distribution

2012-03-03 Thread drflxms
Please allow one (hopefully ;) last question: Do you think the code I adopted from Hänggi is valid in selecting a contour which encloses i.e. 68% of the scatter-plot data? - I am still not completely shore... still looking for the reason of the different result of Hänggis and Foresters code. Should

Re: [R] contour for plotting confidence interval on scatter plot of bivariate normal distribution

2012-03-03 Thread drflxms
Puhh, I am really happy to read that the idea was not completely sensless. This would have heavily damaged my anyway labile view of the world of statistics ;) In any case I need to get to know more about bivariate normal distributions! Any literature recommendations? Felix Am 03.03.12 22:13, schr

Re: [R] contour for plotting confidence interval on scatter plot of bivariate normal distribution

2012-03-03 Thread drflxms
Greg, extremely cool thoughts! Thank you for delving into it this deep. As I mentioned, I am a neurologist with unfortunately poor statistical training. You are professional statisticians. So I'd like to apologize for any unprofessional nomenclature and strange thoughts beforehand. As my previous

Re: [R] contour for plotting confidence interval on scatter plot of bivariate normal distribution

2012-03-03 Thread Greg Snow
To further explain. If you want contours of a bivariate normal, then you want ellipses. The density for a bivariate normal (with 0 correlation to keep things simple, but the theory will extend to correlated cases) is proportional to exp( -1/2 ( x1^2/v1 + x2^2/v2 ) so a contour of the distributi

Re: [R] contour for plotting confidence interval on scatter plot of bivariate normal distribution

2012-03-03 Thread peter dalgaard
On Mar 3, 2012, at 20:25 , drflxms wrote: > "Once you go into two dimensions, SD loses all meaning, and adding > nonparametric density estimation into the mix doesn't help, so just stop > thinking in those terms!" > > This makes me really think a lot! Is plotting the 0,68 confidence > interval i

Re: [R] contour for plotting confidence interval on scatter plot of bivariate normal distribution

2012-03-03 Thread Greg Snow
The key part of the ellipse function is: matrix(c(t * scale[1] * cos(a + d/2) + centre[1], t * scale[2] * cos(a - d/2) + centre[2]), npoints, 2, dimnames = list(NULL, names)) Where (if I did not miss anything) the variable 't' is derived from a chisquare distribution and the c

Re: [R] contour for plotting confidence interval on scatter plot of bivariate normal distribution

2012-03-03 Thread drflxms
Wow, David, thank you for these sources, which I just screened. bagplot looks most promising to me. I found it in the package ‘aplpack’ as well as in the R Graph Gallery http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=112 Ellipses are not exactly what I am heading for. I am looking

Re: [R] contour for plotting confidence interval on scatter plot of bivariate normal distribution

2012-03-03 Thread drflxms
Thank you very much for your thoughts! Exactly what you mention is, what I am thinking about during the last hours: What is the relation between the den$z distribution and the z distribution. That's why I asked for ecdf(distribution)(value)->percentile earlier this day (thank you again for your qu

Re: [R] contour for plotting confidence interval on scatter plot of bivariate normal distribution

2012-03-03 Thread David Winsemius
On Mar 3, 2012, at 12:34 PM, drflxms wrote: Thanx a lot Greg for the hint and letting me not alone with this! Tried ellipse and it works well. But I am looking for something more precise. The ellipse fits the real border to the nearest possible ellipse. I want the "real" contour, if possible.

Re: [R] contour for plotting confidence interval on scatter plot of bivariate normal distribution

2012-03-03 Thread peter dalgaard
On Mar 3, 2012, at 17:01 , drflxms wrote: > # this is the critical block, which I still do not comprehend in detail > z <- array() > for (i in 1:n){ >z.x <- max(which(den$x < x[i])) >z.y <- max(which(den$y < y[i])) >z[i] <- den$z[z.x, z.y] > } As far as I can tell, the po

Re: [R] contour for plotting confidence interval on scatter plot of bivariate normal distribution

2012-03-03 Thread drflxms
Thanx a lot Greg for the hint and letting me not alone with this! Tried ellipse and it works well. But I am looking for something more precise. The ellipse fits the real border to the nearest possible ellipse. I want the "real" contour, if possible. Meanwhile I found an interesting function named

Re: [R] contour for plotting confidence interval on scatter plot of bivariate normal distribution

2012-03-03 Thread Greg Snow
Look at the ellipse package (and the ellipse function in the package) for a simple way of showing a confidence region for bivariate data on a plot (a 68% confidence interval is about 1 SD if you just want to show 1 SD). On Sat, Mar 3, 2012 at 7:54 AM, drflxms wrote: > Dear all, > > I created a bi

Re: [R] contour for plotting confidence interval on scatter plot of bivariate normal distribution

2012-03-03 Thread drflxms
OK, the following seems to work still do not understand exactly why... library(MASS) # parameters: n<-100 # generate samples: set.seed(138813) #seed <- .Random.seed x<-rnorm(n); y<-rnorm(n) # estimate non-parameteric density surface via kernel smoothing den<-kde2d(x, y, n=n) # store z values of

[R] contour for plotting confidence interval on scatter plot of bivariate normal distribution

2012-03-03 Thread drflxms
Dear all, I created a bivariate normal distribution: set.seed(138813) n<-100 x<-rnorm(n); y<-rnorm(n) and plotted a scatterplot of it: plot(x,y) Now I'd like to add the 2D-standard deviation. I found a thread regarding plotting arbitrary confidence boundaries from Pascal Hänggi http://www.mai

Re: [R] Contour plot- repost message

2012-02-29 Thread David Winsemius
On Feb 29, 2012, at 7:08 PM, Leong Keat Chan wrote: Hi, I would like to make a contour plot using R with the following information (data at the end): x-axis= arranged according to day (from 1 to 365, labels= use I am really getting tired of seeing this message. This must be the fourth du

Re: [R] Contour plot- repost message

2012-02-29 Thread Leong Keat Chan
Hi, I would like to make a contour plot using R with the following information (data at the end): x-axis= arranged according to day (from 1 to 365, labels= use months; up to 365 days in one year), y-axis= depth (labels from 0 at the top to 7 at the bottom; this is a water depth profile), and z-a

Re: [R] Contour plot

2012-02-29 Thread Leong Keat Chan
Hi, I would like to make a contour plot using R with the following information (data at the end): x-axis= arranged according to day (from 1 to 365, labels= use months; up to 365 days in one year), y-axis= depth (labels from 0 at the top to 7 at the bottom; this is a water depth profile), and z-a

Re: [R] Contour plot

2012-02-29 Thread Leong Keat Chan
Hi, I would like to make a contour plot using R with the following information (data at the end): x-axis= arranged according to day (from 1 to 365, labels= use months; up to 365 days in one year), y-axis= depth (labels from 0 at the top to 7 at the bottom; this is a water depth profile), and z-a

Re: [R] Contour plot

2012-02-29 Thread lkchan
Hi, I would like to make a contour plot with the data below, x-axis= Day (increasing order, day number is out of 365 days of a year), y-axis= Depth (varies), and z=pH. I tried to use filled.contour function, but not sure the proper way to ordinate my z results into a matrix with different x and y l

Re: [R] Contour plot with messy field data.

2012-02-02 Thread chuck.01
This is ugly, but I think it works.: z.2 <- data.frame(data.interp[[3]]) diff_y <- unique(round(diff(data.interp[[2]]), 4)) diff_x <- unique(round(diff(data.interp[[1]]), 4)) total_area <- length(which(z.2!="NA"))*diff_y*diff_x # percent of total area less than -.5 (as I wanted) Per_neg_0.5 <- (

Re: [R] Contour plot with messy field data.

2012-02-02 Thread chuck.01
Ok, I've since found this: # called previously posted dataset "dat" attach(dat) library(akima) data.interp <- interp(x,y,z) contour(data.interp) any idea how to calculate area within specified contour lines? Thanks chuck.01 wrote > > Hello, > I have some data that will be in the form:

[R] Contour plot with messy field data.

2012-02-02 Thread chuck.01
Hello, I have some data that will be in the form: structure(list(station = structure(c(20L, 2L, 4L, 19L, 3L, 11L, 1L, 5L, 10L, 12L, 17L, 18L, 6L, 9L, 13L, 16L, 7L, 8L, 15L, 14L ), .Label = c("1", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2", "3", "4", "5", "6", "7", "8", "9",

Re: [R] contour(): Thickness contour labels

2012-01-23 Thread David L Carlson
help-boun...@r-project.org] On Behalf Of Andy Richling Sent: Saturday, January 21, 2012 12:04 PM To: r-help@r-project.org Subject: [R] contour(): Thickness contour labels Hi, I want to display some contour labels. It works well, but the thickness of the label is to low. I tried the "labcex

Re: [R] Contour plot on a triangular mesh

2012-01-21 Thread Jim Lemon
On 01/21/2012 09:38 PM, Roary wrote: Thanks for your responses Jason and Jim. The ternary plot is definitely the right style with the triangle fill. However, one of the important features (that perhaps I understated) is that X3 will have more categories than X1 and X2, therefore the triangular sh

[R] contour(): Thickness contour labels

2012-01-21 Thread Andy Richling
Hi, I want to display some contour labels. It works well, but the thickness of the label is to low. I tried the "labcex" command contour(x,y,z, labcex=2) But only the size is rising and not the thickness of labels. Only if i set the value to "labcex=10" the thickness is good, but the size is to

Re: [R] Contour plot on a triangular mesh

2012-01-21 Thread Roary
Thanks for your responses Jason and Jim. The ternary plot is definitely the right style with the triangle fill. However, one of the important features (that perhaps I understated) is that X3 will have more categories than X1 and X2, therefore the triangular shape is not appropriate. If X1 has I cat

Re: [R] Contour plot on a triangular mesh

2012-01-21 Thread Jim Lemon
On 01/20/2012 11:28 PM, Roary wrote: Hi All, I have 3 variables which present a perfect linear dependency such that the third is the sum of the first two. I have an ordinary 2D contour plot on a square grid with the first two variables forming the axes and the third naturally being the diagonals

Re: [R] Contour plot on a triangular mesh

2012-01-20 Thread Jason Edgecombe
I'm not sure if this is appropriate. If the sum of your variables is always the same constant, then you might try a Ternary plot ( http://en.wikipedia.org/wiki/Ternary_plot ). The "vcd" package can make ternary plots. On 01/20/2012 02:56 PM, Roary wrote: I have two observed categorical variab

Re: [R] Contour plot on a triangular mesh

2012-01-20 Thread Roary
I have two observed categorical variables X1 and X2, with X3=X1+X2, and a continuous response Y. I can interpolate the surface and construct an ordinary 2D square contour plot (with X1,X2 axes and X3 on the diagonal). However, I would like to change the orientation of the plot so that the axes fit

Re: [R] Contour plot on a triangular mesh

2012-01-20 Thread Uwe Ligges
Not sure if I understand the question: If you have more data the grid produced by image() or contour() will be finer anyway... Perhaps we just need an example what you are actually asking for. Uwe Ligges On 20.01.2012 13:28, Roary wrote: Hi All, I have 3 variables which present a perfect lin

[R] Contour plot on a triangular mesh

2012-01-20 Thread Roary
Hi All, I have 3 variables which present a perfect linear dependency such that the third is the sum of the first two. I have an ordinary 2D contour plot on a square grid with the first two variables forming the axes and the third naturally being the diagonals. From an interpretive point of view it

Re: [R] Contour on top of 2d histogram

2011-11-17 Thread Sramkova, Anna (IEE)
___ Von: R. Michael Weylandt [michael.weyla...@gmail.com] Gesendet: Mittwoch, 16. November 2011 18:43 Bis: Sramkova, Anna (IEE) Cc: r-help@r-project.org Betreff: Re: [R] Contour on top of 2d histogram Try the add = TRUE argument to contour. Michael On Wed, Nov 16, 2011 at 12:35 PM, Sramkova,

Re: [R] Contour on top of 2d histogram

2011-11-16 Thread R. Michael Weylandt
Try the add = TRUE argument to contour. Michael On Wed, Nov 16, 2011 at 12:35 PM, Sramkova, Anna (IEE) wrote: > Hi all, > > I would like to plot one data set as a 2d histogram and another one as a > contour. I can do it separately with the > "hist2d" and "contour" functions, but I wonder if the

[R] Contour on top of 2d histogram

2011-11-16 Thread Sramkova, Anna (IEE)
Hi all, I would like to plot one data set as a 2d histogram and another one as a contour. I can do it separately with the "hist2d" and "contour" functions, but I wonder if there is a way to combine these two plots into a single one (the ranges of the two plots are the same). Any suggestions? T

[R] Contour plot with time on both X-axis (day) and on Y-axis (hours)

2011-01-13 Thread Xavier Bodin
Hello all, I'd like to graphically represent an hourly temperature timeseries ( http://r.789695.n4.nabble.com/file/n3215785/data.csv data.csv , and see below for pre-process of the data) with the R functions image + contour. To do that I wrote that script : http://r.789695.n4.nabble.com/file/n32

[R] Contour plot with time on X-axis (day) and Y-axis (hours)

2011-01-07 Thread xbodin
Hello all, I'd like to graphically represent an hourly temperature timeseries ( http://r.789695.n4.nabble.com/file/n3179098/data.csv data.csv , and see below for pre-process of the data) with the R functions image + contour. To do that I wrote that script ( http://r.789695.n4.nabble.com/file/n317

[R] contour figure from rsm

2010-11-26 Thread Michal Bosela
Dear r users, I wanted to perform contour figure from response surface model result. I typed this: > model = rsm (Index ~ SO(NV, SKLON, pH), bonita) > summary(model) > par(mfrow = c(2, 3)) > contour (model, ~NV+SKLON+pH) However, I got the error answer as follows: Error in lmobj$data[, nm] :

Re: [R] Contour Plot on a non Rectangular Grid

2010-10-25 Thread David Winsemius
On Oct 25, 2010, at 3:41 AM, Lorenzo Isella wrote: On 10/25/2010 01:32 AM, David Winsemius wrote: You were advised to look at rms. Why have you dismissed this suggestion? Using your data setup below and packaging into a dataframe. require(rms) ddf <- datadist(xysf <- as.data.frame(xys)) ol

Re: [R] Contour Plot on a non Rectangular Grid

2010-10-25 Thread Lorenzo Isella
On 10/25/2010 01:32 AM, David Winsemius wrote: You were advised to look at rms. Why have you dismissed this suggestion? Using your data setup below and packaging into a dataframe. require(rms) ddf <- datadist(xysf <- as.data.frame(xys)) olsfit <- ols(V3~rcs(V1,3)+rcs(V2,3), data=xysf) bounds <

Re: [R] Contour Plot on a non Rectangular Grid

2010-10-25 Thread Jim Lemon
On 10/25/2010 03:30 AM, Lorenzo Isella wrote: Hello, I feel I am drowning in a glass of water. Consider the following snippet at the end of the email, where I generated a set of {x,y,s=f(x,y)} values, i.e. a set of 2D coordinates + a scalar on a circle. Now, I can get a scatterplot in 3D, but ho

Re: [R] Contour Plot on a non Rectangular Grid

2010-10-24 Thread David Winsemius
On Oct 24, 2010, at 9:30 AM, Lorenzo Isella wrote: Hi, And thanks for helping. I am anyway a bit puzzled, since case (1) is not only a matter of interpolation. Probably the point I did not make clear (my fault) is that case (1) in my original email does not refer to an irregular grid o

Re: [R] Contour Plot on a non Rectangular Grid

2010-10-24 Thread Lorenzo Isella
Hi, And thanks for helping. I am anyway a bit puzzled, since case (1) is not only a matter of interpolation. Probably the point I did not make clear (my fault) is that case (1) in my original email does not refer to an irregular grid on a rectangular domain; the set of (x,y) coordinate could sta

Re: [R] Contour Plot on a non Rectangular Grid

2010-10-24 Thread David Winsemius
On Oct 24, 2010, at 6:12 AM, Lorenzo Isella wrote: As to the domain of the function, at least in case (1), that should arise from the collected data points in (x,y) if the sampling is dense enough. And that is precisely what you get from the perimeter function. The earlier Design packag

Re: [R] Contour Plot on a non Rectangular Grid

2010-10-24 Thread Lorenzo Isella
On 10/24/2010 02:55 PM, David Winsemius wrote: On Oct 24, 2010, at 4:30 AM, Lorenzo Isella wrote: 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

Re: [R] Contour Plot on a non Rectangular Grid

2010-10-24 Thread David Winsemius
On Oct 24, 2010, at 4:30 AM, Lorenzo Isella wrote: 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

Re: [R] Contour Plot on a non Rectangular Grid

2010-10-24 Thread Uwe Ligges
On 24.10.2010 14:14, Lorenzo Isella wrote: On 10/24/2010 01:51 PM, (Ted Harding) wrote: On 24-Oct-10 11:30:57, Lorenzo Isella wrote: 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

Re: [R] Contour Plot on a non Rectangular Grid

2010-10-24 Thread Lorenzo Isella
On 10/24/2010 01:51 PM, (Ted Harding) wrote: On 24-Oct-10 11:30:57, Lorenzo Isella wrote: 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

Re: [R] Contour Plot on a non Rectangular Grid

2010-10-24 Thread Ted Harding
On 24-Oct-10 11:30:57, Lorenzo Isella wrote: > 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

[R] Contour Plot on a non Rectangular Grid

2010-10-24 Thread Lorenzo Isella
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 a

Re: [R] contour on a simplex

2010-10-23 Thread David Winsemius
If Dennis' interpretation of your request is correct then Harrell rms/ Hmisc packages provide a mechanism for restricting plotting of contours to the region within a perimeter. He has a perimeter function and the bplot function takes a perim argument. The reason I did not offer it earlier is

Re: [R] contour on a simplex

2010-10-22 Thread Dennis Murphy
Hi: Check out this post on R-help from February, and look carefully at the solution of Walmes Zeviani - I believe it's close to what you're requesting: http://r.789695.n4.nabble.com/Triangular-filled-contour-plot-td1557386.html HTH, Dennis On Fri, Oct 22, 2010 at 6:15 PM, Yunting Sun wrote: >

[R] contour on a simplex

2010-10-22 Thread Yunting Sun
Hello, anyone knows if there is a way in R to draw contour on a simplex based on a function f(x,y,z) with domain (x+y+z = 1)? Thank you! gigi [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mail

[R] Contour Plot - water bodies

2010-09-23 Thread G.ARUN KUMAR
Hi All I have been trying to plot irregular XYZ data on world / country map, where X and Y are llongitude and latitude coordinates and Z is a variable. My problem is I get contour lines over water bodies. The method I follow is:> library(akima)> library(maps)> library(mapdata)> library(gpclib)>

Re: [R] Contour line coordinates

2010-09-15 Thread Duncan Murdoch
On 15/09/2010 11:13 AM, Tonja Krueger wrote: Hi all, I used contour() to add contour lines to a plot. Now I’m wondering if there is a way to get an output of the calculated x- and y- coordinates of the contour lines? ?contourLines Duncan Murdoch ___

Re: [R] Contour line coordinates

2010-09-15 Thread David Winsemius
On Sep 15, 2010, at 11:13 AM, Tonja Krueger wrote: Hi all, I used contour() to add contour lines to a plot. Now I’m wondering if there is a way to get an output of the calculated x- and y- coordinates of the contour lines? ?contourLines # as was suggested to be the first "See(n) Also"

[R] Contour line coordinates

2010-09-15 Thread Tonja Krueger
Hi all, I used contour() to add contour lines to a plot. Now I’m wondering if there is a way to get an output of the calculated x- and y- coordinates of the contour lines? Tonja __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo

Re: [R] Contour - data points not in ascending order?

2010-06-29 Thread Ted Harding
On 29-Jun-10 08:53:48, Kirkeby wrote: > Hi again. > > I have made an example of my data: > > x<-c(1,2,3,4,1,2,3,4,1,2,3,4,1,2,3,4) > y<-c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4) > z <- c(12,23,23,42,12,1,1,32,5,45,65,76,32,21,23,43) > data <- unique(cbind(x,y,z)) > contour(x,y,z, col="red", xlim=c(0,1)

Re: [R] Contour - data points not in ascending order?

2010-06-29 Thread Kirkeby
Hi again. I have made an example of my data: x<-c(1,2,3,4,1,2,3,4,1,2,3,4,1,2,3,4) y<-c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4) z <- c(12,23,23,42,12,1,1,32,5,45,65,76,32,21,23,43) data <- unique(cbind(x,y,z)) contour(x,y,z, col="red", xlim=c(0,1), ylim=c(0,1), labcex=0.7, cex="12") -which gives an e

[R] Contour - data points not in ascending order?

2010-06-29 Thread Kirkeby
Hello everyone. I have been dealing with this for a while. I have built a spatial prediction model for densities of mosquitoes on a field, based om empirical data. I need to plot the field area with the predicted densities in a heatmap, contour or likewise, and compare it visually with i.e. a loe

Re: [R] contour plots

2010-06-22 Thread Duncan Murdoch
On 22/06/2010 9:29 AM, dbeest wrote: Hi All, I'm having difficulty making a contour plot a would like some help. A standard contourplot can be made by having an x,y, and some matrix (shape x*y) with contents: x = 1:10 y = 1:10 cont <- matrix(runif(100,min=1,max=2),nrow=10,ncol=10) filled.conto

[R] contour plots

2010-06-22 Thread dbeest
Hi All, I'm having difficulty making a contour plot a would like some help. A standard contourplot can be made by having an x,y, and some matrix (shape x*y) with contents: x = 1:10 y = 1:10 cont <- matrix(runif(100,min=1,max=2),nrow=10,ncol=10) filled.contour(x,y,cont) Looks very nice. Somet

Re: [R] contour & persp

2010-02-09 Thread Peter Ehlers
Further to Uwe's answer: I suspect that you're not telling us the whole story (that's why it's so useful to have reproducible code). Try this: x <- y <- 1:3 z <- outer(x, y) z[1,1] <- 1/0 persp(x,y,z) which results in: Error in persp.default(x, y, z) : invalid 'z' limits So, are some your

Re: [R] contour & persp

2010-02-08 Thread Uwe Ligges
On 07.02.2010 22:46, Andrew Wang wrote: I have this data set that both x& y are ordered vectors of length 600& 700 respectively; z is a 600 by 700 matrix whose entry z[i,j] is either a missing value (indicated by 'NaN') or a real number between 0 and 1. The contour function contour(x,y,z

[R] contour & persp

2010-02-07 Thread Andrew Wang
I have this data set that both x & y are ordered vectors of length 600 & 700 respectively; z is a 600 by 700 matrix whose entry z[i,j] is either a missing value (indicated by 'NaN') or a real number between 0 and 1. The contour function contour(x,y,z) gives me a blank picture. I guess the

Re: [R] contour function: changing colour according to different levels

2010-02-03 Thread Paul Hiemstra
karine heerah wrote: Hi everybody, I am using the contour function to draw isobares. And i would like to to bold contours for an interval of 500m and weak contour for an interval of 100m. Can someone help me with this? Thanks a lot Karine ___

[R] contour function: changing colour according to different levels

2010-02-03 Thread karine heerah
Hi everybody, I am using the contour function to draw isobares. And i would like to to bold contours for an interval of 500m and weak contour for an interval of 100m. Can someone help me with this? Thanks a lot Karine _

Re: [R] contour(): lines & labels in different colours?

2009-11-22 Thread David Winsemius
On Nov 22, 2009, at 8:01 PM, Duncan Murdoch wrote: On 22/11/2009 6:28 PM, (Ted Harding) wrote: Wow! (Top-posting for once, since there's no natural other place ...) Thanks Peter, David and Duuncan for the suggestions. I'll look at the later ones from David & Duncan later (it's getting late her

Re: [R] contour(): lines & labels in different colours?

2009-11-22 Thread Duncan Murdoch
On 22/11/2009 6:28 PM, (Ted Harding) wrote: Wow! (Top-posting for once, since there's no natural other place ...) Thanks Peter, David and Duuncan for the suggestions. I'll look at the later ones from David & Duncan later (it's getting late here). However, as something to work on if you want to,

Re: [R] contour(): lines & labels in different colours?

2009-11-22 Thread Ted Harding
Wow! (Top-posting for once, since there's no natural other place ...) Thanks Peter, David and Duuncan for the suggestions. I'll look at the later ones from David & Duncan later (it's getting late here). However, as something to work on if you want to, here is a toy example, based on the same overa

Re: [R] contour(): lines & labels in different colours?

2009-11-22 Thread David Winsemius
On Nov 22, 2009, at 5:35 PM, Duncan Murdoch wrote: On 22/11/2009 5:21 PM, David Winsemius wrote: On Nov 22, 2009, at 4:57 PM, Peter Ehlers wrote: Hi Ted, This won't solve your problem, but a small improvement might be to place the labels over the lines rather than the other way around. It wi

Re: [R] contour(): lines & labels in different colours?

2009-11-22 Thread Duncan Murdoch
On 22/11/2009 5:35 PM, Duncan Murdoch wrote: On 22/11/2009 5:21 PM, David Winsemius wrote: On Nov 22, 2009, at 4:57 PM, Peter Ehlers wrote: Hi Ted, This won't solve your problem, but a small improvement might be to place the labels over the lines rather than the other way around. It will defi

Re: [R] contour(): lines & labels in different colours?

2009-11-22 Thread Duncan Murdoch
On 22/11/2009 5:21 PM, David Winsemius wrote: On Nov 22, 2009, at 4:57 PM, Peter Ehlers wrote: Hi Ted, This won't solve your problem, but a small improvement might be to place the labels over the lines rather than the other way around. It will definitely avoid putting red lines over black ones

Re: [R] contour(): lines & labels in different colours?

2009-11-22 Thread David Winsemius
On Nov 22, 2009, at 4:57 PM, Peter Ehlers wrote: Hi Ted, This won't solve your problem, but a small improvement might be to place the labels over the lines rather than the other way around. It will definitely avoid putting red lines over black ones: x <- -6:16 z <- outer(x,x) contour(z, label

Re: [R] contour(): lines & labels in different colours?

2009-11-22 Thread Peter Ehlers
Hi Ted, This won't solve your problem, but a small improvement might be to place the labels over the lines rather than the other way around. It will definitely avoid putting red lines over black ones: x <- -6:16 z <- outer(x,x) contour(z, labels="", col=2) contour(z, lty=0, labcex=1, add=TRUE)

[R] contour(): lines & labels in different colours?

2009-11-22 Thread Ted Harding
Greetings, All! I want to draw contour lines in red, using contour(), but also have the contour labels (for the level-values) in black so that they will stand out against a coloured background already generated using filled.contour() (the background shades from green at low levels of "risk" to red

  1   2   >