Hi ! I am wondering how to plot data (e.g. f(x,y) ) in a coordinate system spanned by two non-orthogonal basis vectors (e.g. hexagonal symmetry). The data is given on an equally spaced grid in theses coords and i would like to do a contour plot (e.g. with filled.contour). Thanks for your help. Andreas
plotting data in non-orthogonal coords.
5 messages · Andreas Franke, PIKAL Petr, Deepayan Sarkar
Hallo Andreas There is probably no one who can give you some answer as you did provide almost no facts what you really did and what is wrong. You probably need to transform your coordinates to orthogonal and plot them as you wish. But you have to do it yourself. I had some data in polar coordinates some time ago and I did the same (see attached picture). Cheers Petr
On 29 Nov 2004 at 14:29, Andreas Franke wrote:
Hi ! I am wondering how to plot data (e.g. f(x,y) ) in a coordinate system spanned by two non-orthogonal basis vectors (e.g. hexagonal symmetry). The data is given on an equally spaced grid in theses coords and i would like to do a contour plot (e.g. with filled.contour). Thanks for your help. Andreas
______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Petr Pikal petr.pikal at precheza.cz
Am Dienstag, 30. November 2004 10:26 schrieb Petr Pikal:
Hallo Andreas There is probably no one who can give you some answer as you did provide almost no facts what you really did and what is wrong. You probably need to transform your coordinates to orthogonal and plot them as you wish. But you have to do it yourself. I had some data in polar coordinates some time ago and I did the same (see attached picture). Cheers Petr On 29 Nov 2004 at 14:29, Andreas Franke wrote:
Hi ! I am wondering how to plot data (e.g. f(x,y) ) in a coordinate system spanned by two non-orthogonal basis vectors (e.g. hexagonal symmetry). The data is given on an equally spaced grid in theses coords and i would like to do a contour plot (e.g. with filled.contour). Thanks for your help. Andreas
______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Petr Pikal petr.pikal at precheza.cz
Hi ! Thanks for replying to my post and sorry for not being specific enough. Maybe I am the one who didnt get the point , but as far as I understand R plots filled.contour(x,y,z,...) in the following way: x,y define a grid in cartesian coords, i.e. the angle between x and y is 90??. So if I have data on such a grid I am fine. My data is on an equally spaced grid in a coordsystem where x and y are at an angle of 60??. If you transform into cartesiancoords this isnt an equally spaced grid anymore. You could interpret it as an equally spaced grid on which there is only data given on every second grid point. It would be nice if one could just plot data given as F(x,y) where you supply x and y for every data point seperatly so that you dont need any specific grid. I hope that someone can help. Thanks in advance. Andreas
On 30 Nov 2004 at 11:06, Andreas Franke wrote:
<snip>
Hi ! Thanks for replying to my post and sorry for not being specific enough. Maybe I am the one who didnt get the point , but as far as I understand R plots filled.contour(x,y,z,...) in the following way: x,y define a grid in cartesian coords, i.e. the angle between x and y is 90??. So if I have data on such a grid I am fine. My data is on an equally spaced grid in a coordsystem where x and y are at an angle of 60??. If you transform into cartesiancoords this isnt an equally spaced grid anymore. You could interpret it as an equally spaced grid on which there is only data given on every second grid point. It would be nice if one could just plot data given as F(x,y) where you supply x and y for every data point seperatly so that you dont need any specific grid.
Maybe interp() in akima package can help you, but as I said it strongly depends on what you really want to achieve. Cheers Petr
I hope that someone can help. Thanks in advance. Andreas
Petr Pikal petr.pikal at precheza.cz
On Tuesday 30 November 2004 04:06, Andreas Franke wrote:
[...]
It would be nice if one could just plot data given as F(x,y) where you supply x and y for every data point seperatly so that you dont need any specific grid.
This is one solution, but it's not exactly what you want: library(lattice) u <- row(matrix(0, nrow = 10, ncol = 15)) v <- col(matrix(0, nrow = 10, ncol = 15)) x <- u y <- .5 * u + .3 * v z <- log(u + v) wireframe(z ~ x * y) Deepayan