I try to force a 3D plot to have equally scaled x,y and z axes. For this
I tried the new equal_axes option for the set view command. Here is an
excerpt from the script file
set term x11
set size ratio -1
set view 0.,0.,1.,1.
set view equal_axes
splot 'something.dat' using 1:2:3:(f($4)) w p lc palette
the set size ratio -1 was intended to force a quadratic plotting area;
however, this doesn't seem to work in splot.
According to the help page equal_axes should force the plot to be
rescaled to show equal axes. However, unfortunately I still get a
flattened image where the horizontal dimensions are elongated against
the vertical ones. The only way to get a more or less correct display
that I can see is to reshape the plotting window manually using the mouse.
I wonder whether there is a more elegant (and also exact!) way to do this...
Ingo
> Hi,
>
> the set size ratio -1 was intended to force a quadratic plotting area;
> however, this doesn't seem to work in splot.
Correct. "set size ratio" has no effect on 3D plots
> According to the help page equal_axes should force the plot to be
> rescaled to show equal axes.
gnuplot> help set view equal
The command `set view equal_axes` forces the unit length of the
x and y axes to be on the same scale. Otherwise by default both
axes are scaled to fill the available area.
So, only the x and y axes.
> However, unfortunately I still get a
> flattened image where the horizontal dimensions are elongated against
> the vertical ones. The only way to get a more or less correct display
> that I can see is to reshape the plotting window manually using the mouse.
>
> I wonder whether there is a more elegant (and also exact!) way to do
> this...
You can change the scale on Z from the command line also:
Zscale=2
set view ,,,Zscale
But I do not know how to calculate the precise Zscale needed to
match an existing X/Y scale.
The "set view equal_axes" command is relatively recent.
It may need some additional refinement. Perhaps
it should really be 2 separate commands
set view equal_xy
set view equal_xyz
> Correct. "set size ratio" has no effect on 3D plots
Why?
> You can change the scale on Z from the command line also:
> Zscale=2
> set view ,,,Zscale
The z-axis is not the problem. I'd rather think that the problem is the
aspect ratio of the default X11 window, which cannot be changed since
there is (according to the manual) no size parameter for X11. Because
the x and y axes are roughly horizontal/vertical (at least in my plot
that starts with a view directly from above the x-y-plane), I first
thought the x-y-scaling was the problem.
What I would need is a method to open an X11 window of the correct
shape, i.e. more quadratic than the usual "widescreen" format. In other
terminals, like aqua, this works fine, but there is no mouse control for
these.
What I want is to display a 3D distribution of particles in an X11
window (i.e. freely rotatable by mouse) that appear as a correct 2D
projection on the screen. The default x11 window is much wider than
high, and thus the whole image appears unnaturally flat. I have to
reshape the window by mouse, but this is far from being exact (and it's
annoying to do this every time).
Ingo
> sfeam wrote:
>
>> Correct. "set size ratio" has no effect on 3D plots
>
> Why?
I don't know. It's been that way for as long as I've used gnuplot.
You can set the default x11 window size to whatever you like.
If you like it square, fine. You don't need a special gnuplot command
for that.
Anyhow, please try from today's CVS source tree:
set view equal xyz
I can't help but for me this does not quite work as expected, at
least not for x11 and wxt. It only works for a square canvas. With
the default window size the x axis is broader than the y axes when
looked from above.
Juergen
> You can set the default x11 window size to whatever you like.
Where can I set the defaults, and what is the correct syntax for these
settings? In addition, is there any useful manual for X11 where all
commands and settings (and how they could be changed) are described? Or
is there really no X11 manual (Google doesn't seem to find any standard
reference)?
Even if it could be changed outside Gnuplot I would find it very useful
if there were any possibility to set the canvas for individual plots.
Its not very useful to change the defaults for the whole x11 just for
one single plot. Or is there no easy way to implement such thing into
Gnuplot (or any other application)?
> Anyhow, please try from today's CVS source tree:
>
> set view equal xyz
Unfortunately, I cannot see any positive effect on the x11 window.
Ingo
> sfeam wrote:
>
>> You can set the default x11 window size to whatever you like.
>
> Where can I set the defaults, and what is the correct syntax for these
> settings?
From the command line:
gnuplot -geometry 500x500
From an Xresources file
gnuplot*geometry: 500x500
> In addition, is there any useful manual for X11 where all
> commands and settings (and how they could be changed) are described?
I don't know. I have 5 large manuals on my shelf, but none of them
are useful at the user level.
> Even if it could be changed outside Gnuplot I would find it very useful
> if there were any possibility to set the canvas for individual plots.
> Its not very useful to change the defaults for the whole x11 just for
> one single plot. Or is there no easy way to implement such thing into
> Gnuplot (or any other application)?
Mike Sutton has submitted a patch to allow revising the size when the
terminal is selected:
set term x11 size 500,500
The patch is on SourceForge as tracker item
#1553072 set term x11 geometry option
It is still under discussion there. You are welcome to add your
thoughts.
>> Anyhow, please try from today's CVS source tree:
>>
>> set view equal xyz
>
> Unfortunately, I cannot see any positive effect on the x11 window.
Yes, the new feature only works properly for terminals with isomorphous
scaling. Unfortunately that is not true for either x11 or windows.
I have been experimenting with a work-around for x11, but so far I
haven't found an acceptable one.
> From the command line:
> gnuplot -geometry 500x500
> From an Xresources file
> gnuplot*geometry: 500x500
Ah thanks.
> Mike Sutton has submitted a patch to allow revising the size when the
> terminal is selected:
> set term x11 size 500,500
How do I install patches on an existing Gnuplot (CVS) installation
(normally, I install patches to programs via their installation wizard
;-))? Is there any manual out there? Or just copy the new piece of
source into Gnuplot's src folder and do the usual prepare, config & make?
Ingo
>> Mike Sutton has submitted a patch to allow revising the size when the
>> terminal is selected:
>> set term x11 size 500,500
>
> How do I install patches on an existing Gnuplot (CVS) installation
http://gnuplot.sourceforge.net/development/ethans_instructions.html