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 how to get a 2D surface
plot/levelplot?
An idea could be to artificially set the z coordinate of the plot as a
constant (instead of having it equal to s as in the scatterplot) and
calculate the colormap with the values of s, along the lines of the
volcano example + surface plot at

http://bit.ly/9MRncd

but I am experiencing problems. However, should I really go through all
this? There is nothing truly 3D in the plot that I have in mind, you can
think of it as e.g. some temperature measurement along a tube cross
section.

Hi Lorenzo,
I'm a bit pressed for time at the moment so I can't write an example, but why not just define an empty rectangular plot:

plot(0,xlim=<your xlimits>,ylim=<your ylimits>,type="n",axes=FALSE,
 xlab="",ylab="")

create a matrix of NA values, only calculate the ones that are inside your shape and display it in the same way that color2D.matplot(plotrix) does? You should get the shape you want with all of the unwanted cells blank.

Jim

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to