search for: meshgrid

Displaying 4 results from an estimated 4 matches for "meshgrid".

2002 Mar 26
1
ellipsis question
...] 3 8 15 </fantasy> One object is to have b <- c(0,1) and then ntuple(b,b,b,b,b,b,b,b) will generate all 256 distinct bytes. I tried to use the ellipsis argument "..." with no success (because it takes only named arguments). Any help anyone? While I'm writing, my meshgrid() below works as per octave's, but it's a bit clunky. Is there anything better? This is the only thing I've found so far that Octave can do that I can't easily replicate in R. thanks in advance ===work done so far=== meshgrid <- function(x,y) { ignore.arg2 <-...
2010 Aug 11
2
question on contour function
Dear All, I tried to plot contour lines using R function contour, but got the results which are not expected. require(RTOMO) x <- seq(-1,1,0.1) y <- seq(-1,1,0.1) xy <- meshgrid(x,y) z <- xy$x^2+ 3*xy$y^2 contour(x,y,z,col="blue",xlab="x",ylab="y") The above code gave me the contour graph for z=3*x^2+y^2 rather than z=x^2+3*y^2. Is anyone know the reason? Thank you very much in advance. David [[alternative HTML version deleted]]
2006 May 26
2
Is there a way to draw 3d plot?
Hi all, I have a 2D matrix, which has 100 rows, and 100 columns, I have a 2D matrix, with 100 rows and 100 columns, I want to display it using 3D plot, much like plot3d and mesh/surf functions in matlab. Specifically, in matlab, I just need to do the following: -------- [X, Y]=meshgrid([0:0.01:0.99, 0:0.01:0.99]); % Z is my 2D matrix, surf(X, Y, Z); -------- Note that X and Y are created so that I can associate physical meaning onto the x and y axis of the 3D plot. For example, my 100 rows represent 0, 0.01, 0.02, ... 0.99 here. In Matlab I can also drag in the graphic window...
2012 Mar 02
1
3d surface plot (ideally using rgl package)?
Dear HelpeRs, I would be grateful for anybody who might help to produce the following plot (the code for matlab is below) using the "rgl" package of R? [t,r] = meshgrid(linspace(0,2*pi,361),linspace(-4,4,101)); [x,y] = pol2cart(t,r); P = peaks(x,y); figure('color','white'); polarplot3d(P,'colordata',gradient(P)); view([-18 72]); You may see the code and plot output at: https://plus.google.com/u/0/109789409461372488563/posts/YfcrsMhkjyf M...