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

Swap plot axes

2,884 views
Skip to first unread message

Rishi

unread,
Feb 26, 2008, 7:41:38 PM2/26/08
to
Hi,

By default x and y are the base plane axes in a 3-d plot and z is
vertically up. I need to swap them, as in, make x the vertical axes
once and then make y once. I know its possible using set view but I
havnt been able to figure out the right angle measures. Any one know
top of their head ?

Thanks a ton !

Rishi

Ben

unread,
Feb 27, 2008, 4:11:16 AM2/27/08
to

instead of splot 1:2:3
you can do like this :

set xlabel " z "
set ylabel " y "
set zlabel " x "

splot 3:2:1

Rishi

unread,
Feb 27, 2008, 11:03:17 AM2/27/08
to
On Feb 27, 3:11 am, Ben <benoit.bar...@gmail.com> wrote:
>
> instead of splot 1:2:3
> you can do like this :
>
> set xlabel " z "
> set ylabel " y "
> set zlabel " x "
>
> splot 3:2:1

Well, the idea was that I was plotting contours of a 3-D plot. Now
gnuplot only seems to plot contours on the base plane. What if I want
the contours on one of the vertical planes ?. I though maybe I could
rotate or something. Any ideas ?

Rishi

Hans-Bernhard Bröker

unread,
Feb 27, 2008, 3:34:59 PM2/27/08
to
Rishi wrote:

> By default x and y are the base plane axes in a 3-d plot and z is
> vertically up. I need to swap them, as in, make x the vertical axes
> once and then make y once.

Why? What do you care which of the axes is internally called "x"? It's
not like there would be some kind of forced label "this axis is 'x'" on
the axis, right?

> I know its possible using set view

Actually, no it's not. "set view" will not rotate the z axis away from
the screen's vertical, so neither can be "the" vertical axis --- they
can only be coincident with the vertical z axis, and I strongly doubt
you want that.

Rishi

unread,
Feb 27, 2008, 4:24:50 PM2/27/08
to
On Feb 27, 2:34 pm, Hans-Bernhard Bröker <HBBroe...@t-online.de>
wrote:

> Why? What do you care which of the axes is internally called "x"? It's
> not like there would be some kind of forced label "this axis is 'x'" on
> the axis, right?
It becomes important when you draw contours. Gnuplot seemingly only
draws contours on the base. I cant figure out how to draw them on the
vertical planes.

Rishi

Hans-Bernhard Bröker

unread,
Feb 27, 2008, 4:50:17 PM2/27/08
to
Rishi wrote:

> It becomes important when you draw contours. Gnuplot seemingly only
> draws contours on the base.

Not quite. gnuplot only *computes* isolines of constant z. It can draw
them either as a projection onto the base, or at their original z level.

What you would have to do is split the computation from the drawing
step. See "help table".

Ben

unread,
Mar 1, 2008, 3:50:44 AM3/1/08
to
On Feb 27, 10:50 pm, Hans-Bernhard Bröker <HBBroe...@t-online.de>
wrote:

Yes you can do like this :

set term table
set output "table.tbl"

set nosurface
set contour

set xrange ... and fixes y and z

splot "data" using 1:2:3

set term postcscript (or else)
set surface
unset contour

set multiplot
splot "data" using 1:2:3
unset surface
splot 'table.tbl" u 1:2:($3*0) w lines, table.tbl" u 1:($2*0):3 w
lines, table.tbl" u ($1*0):2:3 w lines
unset multiplot


Probably there is more elegant for the end.

0 new messages