Re: [R] persp fail with non-equidistant dates

2016-08-22 Thread Duncan Murdoch
Please keep discussion on the mailing list. On 22/08/2016 12:08 PM, Tomas Bayer wrote: Hello, we have tried the pre-processing till now but also with this error message: akima.li <- interp(x, y, F, xo=seq(min(x), max(x), length = 100), yo=seq(min(y), max(y), length = 100)) Error: could not find

Re: [R] persp fail with non-equidistant dates

2016-08-22 Thread Duncan Murdoch
On 22/08/2016 11:17 AM, Tomas Bayer wrote: Hello, when I plotted non-equidistant data in 3D (using persp and contour), it was ended with the same error message: persp(y, x, z, xlab="latitude", ylab="longitude", zlab="altiude", main="Altitude") Error in persp.default(y, x, z, xlab = "latitude",

Re: [R] persp and Response surface models

2013-12-03 Thread Erin Hodgess
SOLVED: xs <- canonical(smell.rsm)$xs > xs x1x2x3 0.1219125 0.1995746 1.7705249 > persp(smell.rsm,~x1+x2,at=xs,contour=TRUE) > On Tue, Dec 3, 2013 at 9:33 PM, Erin Hodgess wrote: > Dear R People: > > I am using Response Surface Models and and also using the "persp" fun

Re: [R] persp() problem

2011-11-19 Thread William Dunlap
The trailing space (instead of '0') in the third line of the printout of z, the fact that the decimal points are not aligned in the columns, and the left- justification of the column labels are hints that z is not a matrix of numbers, but just prints something like one. *> z* * [,1] [,2]

Re: [R] persp() problem

2011-11-19 Thread Rolf Turner
Your call to persp() is fine, and works just fine for me. Obviously there is something funny about your data (x, y, and z). They must not be numeric (despite appearances). There is something you haven't told us here; how did you obtain/construct x, y, and z? Try the following: x <- y <- 5*(0:

Re: [R] persp() problem

2011-11-19 Thread David Winsemius
On Nov 19, 2011, at 3:19 PM, John Benning wrote: Hi, and thanks in advance for any assistance, I'm new to R and to this mailing list, and am having trouble with the * persp()* function. I've got a matrix (z) of values for various combinations of x and y, each of which is a set of (0, 5, 10

Re: [R] persp()

2011-08-05 Thread Johannes Hüsing
Am Donnerstag, den 04.08.2011, 02:58 +0200 schrieb Rosario Garcia Gil: > I am trying to draw a basic black and white map of two European countries. > Are you planning just to draw the boundaries? Or what do you mean by "basic black and white". > After searching some key words in google and readi

Re: [R] persp()

2011-08-04 Thread Jean V Adams
Rosario, I don't think persp() is the function you need. You may find that the maps in R's historical world map would work for you. In that case you can try something like this (an example mapping France and Germany): require(maps) map("world", c("France", "Germany"), xlim=c(-6.61, 17.21), yl

Re: [R] persp()

2011-08-04 Thread Eik Vettorazzi
Hi Rosario, you might have a look at the "maps" and "maptools" (for reading shape-files) packages. #e.g. library(maps) map("world",c("sweden","germany")) Cheers Am 04.08.2011 02:58, schrieb Rosario Garcia Gil: > Hello > > I am trying to draw a basic black and white map of two European countri

Re: [R] persp and trans3d for type="h" points

2011-06-14 Thread Uwe Ligges
You are drawing the line to the center of the plot (which is 0 be design). What you actually want is to plot segments to the min(z) value. Example: Z <- matrix(1:9, 3) surf <- persp(1:3, 1:3, Z) points(trans3d(x=2, y=2, z=5, surf), col="red", pch=19) from <- trans3d(x=2, y=2, z=5, surf) to <- t

Re: [R] persp(); help with 'tck' option

2010-05-26 Thread Sean Anderson
On Wed, May 26, 2010 at 8:53 PM, Kim Jung Hwa wrote: > I'm using 'tck' option to *reduce* the length of tick marks but it is not > working, can anyone please tell me where I'm going wrong... > > require(graphics) > require(grDevices) > x <- seq(-10, 10, length= 30) > y <- x > f <- function(x,y) { r

Re: [R] persp function question

2009-11-09 Thread Duncan Murdoch
On 11/9/2009 1:00 PM, STEFFEN Julie wrote: Hello, I have a question about persp function: I made my classical matrix with x, y and z variables and I dont know why I obtain a 3D image with overestimate heights. How can you tell it overestimates heights? There's no scale given. Duncan Murdoch

Re: [R] 'persp' query

2009-10-07 Thread Peter Ehlers
xt, but didn't try it, as was unsure what the appropriate 'side' value would be. Any thoughts? Cheers Geoff -Original Message- From: Peter Ehlers [mailto:ehl...@ucalgary.ca] Sent: Wednesday, 7 October 2009 1:43 AM To: David Winsemius Cc: Geoffrey William Heard; r-help@r-pr

Re: [R] 'persp' query

2009-10-06 Thread David Winsemius
Wednesday, 7 October 2009 1:43 AM To: David Winsemius Cc: Geoffrey William Heard; r-help@r-project.org Subject: Re: [R] 'persp' query David Winsemius wrote: On Oct 6, 2009, at 4:46 AM, Geoffrey William Heard wrote: Hi All I'm creating some 3-D plots using the function '

Re: [R] 'persp' query

2009-10-06 Thread Geoffrey William Heard
id Winsemius Cc: Geoffrey William Heard; r-help@r-project.org Subject: Re: [R] 'persp' query David Winsemius wrote: > > On Oct 6, 2009, at 4:46 AM, Geoffrey William Heard wrote: > >> Hi All >> >> I'm creating some 3-D plots using the function 'pers

Re: [R] 'persp' query

2009-10-06 Thread Peter Ehlers
David Winsemius wrote: On Oct 6, 2009, at 4:46 AM, Geoffrey William Heard wrote: Hi All I'm creating some 3-D plots using the function 'persp', and have a query regarding the ability to make changes to the label of the z-axis. There are two things I would like to do. First, the default s

Re: [R] 'persp' query

2009-10-06 Thread David Winsemius
On Oct 6, 2009, at 4:46 AM, Geoffrey William Heard wrote: Hi All I'm creating some 3-D plots using the function 'persp', and have a query regarding the ability to make changes to the label of the z- axis. There are two things I would like to do. First, the default setting places the lab

Re: [R] 'persp' query

2009-10-06 Thread Peter Ehlers
Geoff, One way (the only way without modifying source code?) to satisfy your first wish is to insert a newline before your label as in zlab = "\nMy z-text". I don't know of an answer for your second wish other than using the single letter "Z" as your label :) -Peter Ehlers Geoffrey William

Re: [R] persp plot + plotting grid lines

2009-03-15 Thread Duncan Murdoch
On 15/03/2009 10:07 AM, Kingsford Jones wrote: Building on Duncan's code, here's an approximation to the Matlab 'peaks' plot referred to by Pedro: peaks <- function(x, y) { 3 * (1-x)^2 * exp(-(x^2)-(y+1)^2) - 10 * (x/5-x^3-y^5) * exp(-x^2-y^2) - 1/3*exp(-(x+1)^2-y^2)} x <- y <- seq(-3,3,.1)

Re: [R] persp plot + plotting grid lines

2009-03-15 Thread Kingsford Jones
Building on Duncan's code, here's an approximation to the Matlab 'peaks' plot referred to by Pedro: peaks <- function(x, y) { 3 * (1-x)^2 * exp(-(x^2)-(y+1)^2) - 10 * (x/5-x^3-y^5) * exp(-x^2-y^2) - 1/3*exp(-(x+1)^2-y^2)} x <- y <- seq(-3,3,.1) z <- outer(x,y, peaks) z2 <- 10 * round(c(z) + ab

Re: [R] persp plot + plotting grid lines

2009-03-15 Thread David Winsemius
This wiki page has the answer. Draw the plot first to establish the coordinate system and create the viewing transformation matrix. Draw the grid lines with lines(trans3d()), and then put a: par(new=T) ... and then redraw the plot over the gridlines.

Re: [R] persp plot + plotting grid lines

2009-03-14 Thread Duncan Murdoch
On 14/03/2009 12:02 PM, Pedro Mardones wrote: Dear all; Does anyone know how to add grid lines to a persp plot? I've tried using lines(trans3d..) but the lines of course are superimposed into the actual 3d surface and what I need is something like the plot shown in the following link: http://ther

Re: [R] persp plot + plotting grid lines

2009-03-14 Thread David Winsemius
On Mar 14, 2009, at 12:02 PM, Pedro Mardones wrote: Dear all; Does anyone know how to add grid lines to a persp plot? I've tried using lines(trans3d..) but the lines of course are superimposed into the actual 3d surface and what I need is something like the plot shown in the following link: htt

Re: [R] persp plot + plotting grid lines

2009-03-14 Thread David Winsemius
Ideas... not a solution. Plot the grid within your ranges using something along the lines, literally and figuratively, based on the second example of persp's help pages. For the z=8 grid lines on that example you could use: for (ix in seq(-10,10, by=5)) lines (trans3d(x=ix, y=seq(-10,10,

Re: [R] persp plot

2008-06-25 Thread Ben Bolker
Chad Junkermeier byu.edu> writes: > > I have a set of data in the form > x1, y1, z1 > x1, y2, z2 > ... > x1, yN, zN > x2, y1, z(N+1) > x2, y2, z(N+2) > ... > x2, yN, z(2N) > ...and so on... > xM, yN, val(M*N) > > Do you have any suggestions? Not at all carefully tested, but: ## make up dat

Re: [R] persp plot

2008-06-24 Thread Chad Junkermeier
Thanks for your reply. When I did what you said z <- t(matrix(zdata, nrow = length(ydata))) persp(xdata, ydata, z) I got the following errors: Error in persp.default(xdata, ydata, z) : invalid 'x' argument Calls: persp -> persp.default In addition: Warning messages: 1: In min(x, na.rm = na.r

Re: [R] persp question

2008-03-12 Thread Duncan Murdoch
On 11/03/2008 2:40 PM, [EMAIL PROTECTED] wrote: > someone sent in a question earlier about doing > something in 3D so i took a stab at it purely > for educational purposes ( i'm not even sure that I understood the question > actually ). > > Unfortunately, persp gives me an error that I don't un

Re: [R] persp question

2008-03-11 Thread David Winsemius
<[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > someone sent in a question earlier about doing > something in 3D so i took a stab at it purely > for educational purposes ( i'm not even sure that I understood the > question actually ). > > Unfortunately, persp gives me an error that I do

Re: [R] persp() misfeature

2007-12-02 Thread Duncan Murdoch
On 02/12/2007 2:16 PM, Allen McIntosh wrote: > Version: Observed in 2.5.1 > >> x <- 1:10 >> y <- 1 >> z <- array(1:10,dim=c(10,1)) >> persp(x,y,z) > Error in persp(x, y, z, xlim, ylim, zlim, theta, phi, r, d, scale, expand, : > invalid 'x' argument > > > The problem isn't 'x'. It's 'y'

Re: [R] persp() problem

2007-09-11 Thread Petr PIKAL
Hi He is actually plotting DM matrix against default values [0,1]. So what he needs to do is to change y to c(1,10) and x to seq(1,20,2) to enable his code work. And even in that case there is not possible AFAIK to control exact labeling of axes as they are internaly recalculated to [0,1] value

Re: [R] persp() problem

2007-09-11 Thread Xavier Abulker
There is an error in your code: in persp(x , y , z) the length of x is the number of rows of z, the length of y is the number of columns of z, You should also name the rows and columns in z with x and y Economics Guy wrote: > > I am having some trouble getting the persp() package to change th