|
From: Jonathan T. <jt...@ae...> - 2005-10-04 11:05:04
|
William Estrada asked:
> How can I make gnuplot produce a 3D plot with true prespective. By
> that I mean that X, Y and Z
> all relate to each other. The scale of X, Y and Z are the same.
Juergen Wieferink replied
| I am not sure what you mean. If you simply want to change the aspect
| ratio of the plot, you should have a look at the "help size"
| documentation page.
I think William Estrada's question may be the same as a gnuplot
problem I've struggled with for years; maybe explaining my problem
will help this discussion...
Basically, I want the 'splot' equivalent of 'set size ratio -1'.
That is, suppose I have a bunch of data points on the surface of a
sphere. I'd like to use 'splot' to produce a view of them where the
sphere looks spherical, not ellipsoidal.
For a demonstration, fetch the files
http://www.aei.mpg.de/~jthorn/spool/gnuplot-3d-demo/data.0
http://www.aei.mpg.de/~jthorn/spool/gnuplot-3d-demo/data.1
http://www.aei.mpg.de/~jthorn/spool/gnuplot-3d-demo/data.2
http://www.aei.mpg.de/~jthorn/spool/gnuplot-3d-demo/data.3
http://www.aei.mpg.de/~jthorn/spool/gnuplot-3d-demo/data.4
http://www.aei.mpg.de/~jthorn/spool/gnuplot-3d-demo/data.5
and try the following gnuplot commands:
set hidden3d nooffset
unset key
splot 'data.0' with lines linetype 1, \
'data.1' with lines linetype 2, \
'data.2' with lines linetype 3, \
'data.3' with lines linetype 4, \
'data.4' with lines linetype 5, \
'data.5' with lines linetype 6
(This is adapted from a conference talk I gave a couple of days ago.)
This should show a set of 6 patches covering a sphere. As is, it shows
a rather squashed ellipsoid.
I think this is the same problem that William Estrada described, no?
The current workaround is to manually 'set size', with size parameters
obtained by trial and error (and measuring the resulting plots with a ruler).
As well as being very clumsy, the necessary 'set size' parameters also
differ from one terminal to another.
What's worse, it's almost impossible to determine the right parameters
if the data to be plotted aren't intrinsically spherical. For example,
take a look at
http://www.aei.mpg.de/~jthorn/spool/gnuplot-3d-demo/ahs.t=5.eps
(This was a figure in a published paper of mine about 2 years ago.)
This used the parameters
set view 70, 20
set size 0.75, 1.70
but I had to eyeball these -- there was no practical way to determine
the "correct" parameters.
ciao,
--
-- Jonathan Thornburg <jt...@ae...>
Max-Planck-Institut fuer Gravitationsphysik (Albert-Einstein-Institut),
Golm, Germany, "Old Europe" http://www.aei.mpg.de/~jthorn/home.html
"Washing one's hands of the conflict between the powerful and the
powerless means to side with the powerful, not to be neutral."
-- quote by Freire / poster by Oxfam
|