|
From: Lorenzo I. <lor...@gm...> - 2007-07-01 22:48:25
|
Dear All,
I am fairly new to data plotting and visualization.
My problem should be simple, but it is not straightforward to tackle in
R or Python.
On the cross section of a pipe (i.e. on a circle) I have a temperature
reading of the kind: T=T(r,theta).
I would like to make a 2D contour plot using colors such that one can see
that the domain where I am plotting is actually a circle.
Furthermore, I do not have necessarily an equally spaced grid.
For instance, let me consider the case of 5 theta's and 7 radial
position and consequently 35 values of T (just a simple test):
theta
R T
0.000000000000000000e+00 0.000000000000000000e+00 5.459815003314423620e+01
0.000000000000000000e+00 1.666666666666666574e-01 4.853828855239110851e+01
0.000000000000000000e+00 3.333333333333333148e-01 4.315101251901344881e+01
0.000000000000000000e+00 5.000000000000000000e-01 3.836167151642037965e+01
0.000000000000000000e+00 6.666666666666666297e-01 3.410390059527122020e+01
0.000000000000000000e+00 8.333333333333332593e-01 3.031870066752165016e+01
0.000000000000000000e+00 1.000000000000000000e+00 2.695362096775039973e+01
1.570796326794896558e+00 0.000000000000000000e+00 2.396203225329512776e+01
1.570796326794896558e+00 1.666666666666666574e-01 2.130248067207563523e+01
1.570796326794896558e+00 3.333333333333333148e-01 1.893811334477913277e+01
1.570796326794896558e+00 5.000000000000000000e-01 1.683616770181326316e+01
1.570796326794896558e+00 6.666666666666666297e-01 1.496751749887080329e+01
1.570796326794896558e+00 8.333333333333332593e-01 1.330626922033307302e+01
1.570796326794896558e+00 1.000000000000000000e+00 1.182940327795447999e+01
3.141592653589793116e+00 0.000000000000000000e+00 1.051645503298913731e+01
3.141592653589793116e+00 1.666666666666666574e-01 9.349231221746512333e+00
3.141592653589793116e+00 3.333333333333333148e-01 8.311557855141172624e+00
3.141592653589793116e+00 5.000000000000000000e-01 7.389056098930650407e+00
3.141592653589793116e+00 6.666666666666666297e-01 6.568943029058285532e+00
3.141592653589793116e+00 8.333333333333332593e-01 5.839854501207304871e+00
3.141592653589793116e+00 1.000000000000000000e+00 5.191687680104649871e+00
4.712388980384689674e+00 0.000000000000000000e+00 4.615461046534314882e+00
4.712388980384689674e+00 1.666666666666666574e-01 4.103189942205120566e+00
4.712388980384689674e+00 3.333333333333333148e-01 3.647775927922803252e+00
4.712388980384689674e+00 5.000000000000000000e-01 3.242908421924544982e+00
4.712388980384689674e+00 6.666666666666666297e-01 2.882977255397825012e+00
4.712388980384689674e+00 8.333333333333332593e-01 2.562994933482758420e+00
4.712388980384689674e+00 1.000000000000000000e+00 2.278527524544009530e+00
6.283185307179586232e+00 0.000000000000000000e+00 2.025633220058637107e+00
6.283185307179586232e+00 1.666666666666666574e-01 1.800807713756398032e+00
6.283185307179586232e+00 3.333333333333333148e-01 1.600935643142084031e+00
6.283185307179586232e+00 5.000000000000000000e-01 1.423247420534685892e+00
6.283185307179586232e+00 6.666666666666666297e-01 1.265280855439646635e+00
6.283185307179586232e+00 8.333333333333332593e-01 1.124847036463023642e+00
6.283185307179586232e+00 1.000000000000000000e+00 1.000000000000000000e+00
How would you plot them in order to have a 2D-color plot where one can
understand we are working on a circle (well, maybe it will look like
something different since I have only a few grid points, but the aim
is clear, I hope)?
Despite its simplicity, this has been taking me a long time and I am not
done yet. Someone has recently suggested to learn VTK, but it may be too
much for what I have in mind.
Anyone who can give me a simple script to read that data and get a
contour plot on a pipe's cross section would help me a lot (I am sure
it must amount to a few lines).
Kind Regards
Lorenzo
|
|
From: Thomas S. <t.s...@fz...> - 2007-07-02 14:02:08
|
a contour plot is not so easy unless you have your data on a grid. re-binning a few data points into a grid with 'dgrid3d' doesn't work. so, either you have a reasonable number of data points - so many, that 'set dgrid3d' works - or you do the re-binning (= filling a 2d-histogram) outside of gnuplot. or, for a very low number of data points, a 'poor man's' solution could be: set xrange [-1:1] set yrange [-1:1] set view map set mapping cyl splot 'datafile' using 1:3:2 with points pointtype 5 pointsize 3 palette Lorenzo Isella wrote: > > Dear All, > I am fairly new to data plotting and visualization. > My problem should be simple, but it is not straightforward to tackle in > R or Python. > On the cross section of a pipe (i.e. on a circle) I have a temperature > reading of the kind: T=T(r,theta). > I would like to make a 2D contour plot using colors such that one can see > that the domain where I am plotting is actually a circle. > Furthermore, I do not have necessarily an equally spaced grid. > For instance, let me consider the case of 5 theta's and 7 radial > position and consequently 35 values of T (just a simple test): > > theta > R T > 0.000000000000000000e+00 0.000000000000000000e+00 5.459815003314423620e+01 > 0.000000000000000000e+00 1.666666666666666574e-01 4.853828855239110851e+01 > 0.000000000000000000e+00 3.333333333333333148e-01 4.315101251901344881e+01 > 0.000000000000000000e+00 5.000000000000000000e-01 3.836167151642037965e+01 > 0.000000000000000000e+00 6.666666666666666297e-01 3.410390059527122020e+01 > 0.000000000000000000e+00 8.333333333333332593e-01 3.031870066752165016e+01 > 0.000000000000000000e+00 1.000000000000000000e+00 2.695362096775039973e+01 > 1.570796326794896558e+00 0.000000000000000000e+00 2.396203225329512776e+01 > 1.570796326794896558e+00 1.666666666666666574e-01 2.130248067207563523e+01 > 1.570796326794896558e+00 3.333333333333333148e-01 1.893811334477913277e+01 > 1.570796326794896558e+00 5.000000000000000000e-01 1.683616770181326316e+01 > 1.570796326794896558e+00 6.666666666666666297e-01 1.496751749887080329e+01 > 1.570796326794896558e+00 8.333333333333332593e-01 1.330626922033307302e+01 > 1.570796326794896558e+00 1.000000000000000000e+00 1.182940327795447999e+01 > 3.141592653589793116e+00 0.000000000000000000e+00 1.051645503298913731e+01 > 3.141592653589793116e+00 1.666666666666666574e-01 9.349231221746512333e+00 > 3.141592653589793116e+00 3.333333333333333148e-01 8.311557855141172624e+00 > 3.141592653589793116e+00 5.000000000000000000e-01 7.389056098930650407e+00 > 3.141592653589793116e+00 6.666666666666666297e-01 6.568943029058285532e+00 > 3.141592653589793116e+00 8.333333333333332593e-01 5.839854501207304871e+00 > 3.141592653589793116e+00 1.000000000000000000e+00 5.191687680104649871e+00 > 4.712388980384689674e+00 0.000000000000000000e+00 4.615461046534314882e+00 > 4.712388980384689674e+00 1.666666666666666574e-01 4.103189942205120566e+00 > 4.712388980384689674e+00 3.333333333333333148e-01 3.647775927922803252e+00 > 4.712388980384689674e+00 5.000000000000000000e-01 3.242908421924544982e+00 > 4.712388980384689674e+00 6.666666666666666297e-01 2.882977255397825012e+00 > 4.712388980384689674e+00 8.333333333333332593e-01 2.562994933482758420e+00 > 4.712388980384689674e+00 1.000000000000000000e+00 2.278527524544009530e+00 > 6.283185307179586232e+00 0.000000000000000000e+00 2.025633220058637107e+00 > 6.283185307179586232e+00 1.666666666666666574e-01 1.800807713756398032e+00 > 6.283185307179586232e+00 3.333333333333333148e-01 1.600935643142084031e+00 > 6.283185307179586232e+00 5.000000000000000000e-01 1.423247420534685892e+00 > 6.283185307179586232e+00 6.666666666666666297e-01 1.265280855439646635e+00 > 6.283185307179586232e+00 8.333333333333332593e-01 1.124847036463023642e+00 > 6.283185307179586232e+00 1.000000000000000000e+00 1.000000000000000000e+00 > > > > How would you plot them in order to have a 2D-color plot where one can > understand we are working on a circle (well, maybe it will look like > something different since I have only a few grid points, but the aim > is clear, I hope)? > Despite its simplicity, this has been taking me a long time and I am not > done yet. Someone has recently suggested to learn VTK, but it may be too > much for what I have in mind. > Anyone who can give me a simple script to read that data and get a > contour plot on a pipe's cross section would help me a lot (I am sure > it must amount to a few lines). > Kind Regards > > Lorenzo > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Gnuplot-info mailing list > Gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-info > > -- View this message in context: http://www.nabble.com/Question-on-Plots-on-Non-regular-Grid-tf4009454.html#a11394474 Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: <HBB...@t-...> - 2007-07-02 19:33:48
|
Lorenzo Isella wrote: > I am fairly new to data plotting and visualization. > I would like to make a 2D contour plot using colors such that one can see > that the domain where I am plotting is actually a circle. That's going to be a little tricky. In particular, the seam where theta jumps by 2*pi will be apparent in the plot. > Furthermore, I do not have necessarily an equally spaced grid. It doesn't have to equally spaced as long as it's topologically rectangular, i.e. consists of N rows of M entries. You have to inform gnuplot about where one row ends and the next one begins. See 'help glossary' and 'help datafile' and watch out for 'grid structure'. |