Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

splot centers at bottom of plot

38 views
Skip to first unread message

al-...@xs4all.nl

unread,
Dec 7, 2012, 4:34:19 PM12/7/12
to
When plotting 3d points the plot is centered such that the bottom of the plot is in the center of the graph. That is: the point around which the plot can be rotated and zoomed is at the bottom. Thus, when you want to see the complete graph it covers only half of the window. This happens for example with the following plot:

set view equal xyz
set ticslevel 0
splot "-"
1 2 -10
3 1 -10
1 2 -2
e

By adding the following line of code to the do_3dplot function in graph3d.c the plot center becomes centered in the window :
zcenter3d = -(ceiling_z - floor_z) / 2.0 * zscale3d + 1;

(see http://obooij.home.xs4all.nl/nerdspul/gnuplot/index.html for screendumps and a patch file)

Should I send this as a patch via the sourceforge page?
Or should I first test if this doesn't break other code/plots?

olaf

Hans-Bernhard Bröker

unread,
Dec 9, 2012, 12:30:40 PM12/9/12
to
On 07.12.2012 22:34, al-...@xs4all.nl wrote:

> When plotting 3d points the plot is centered such that the bottom of
> the plot is in the center of the graph.

Actually, that only happens with 'set view equal'. It's a side effect
of conflicting goals. In a nutshell, the thing that's supposed to
rotate keeps changing shape while rotating. That means there is not
really any center of rotation --- because the behaviour in this case is
not actually a rotation.

> By adding the following line of code to the do_3dplot function in
> graph3d.c the plot center becomes centered in the window :

> zcenter3d = -(ceiling_z - floor_z) / 2.0 * zscale3d + 1;

> Should I send this as a patch via the sourceforge page?

Yes, please. An actual patch (i.e. the product of a diff -c original
changed) would be good.

al-...@xs4all.nl

unread,
Dec 15, 2012, 6:42:27 AM12/15/12
to
Ok, thanks for clarifying this. It indeed only happens after a "set view equal xyz".

I added a patch on the sourceforge page (id 3596241). (I hope I did a correct diff...).

0 new messages