[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
plot with multiple axis
From: 
John W. Eaton 
Subject: 
plot with multiple axis 
Date: 
Tue, 14 Apr 1998 15:27:49 0500 (CDT) 
On 14Apr1998, Steven N Harp <address@hidden> wrote:
 I am trying to create plots with either multiple x or y axis. I can do
 it in pure gnuplot, but have not been able to do it in octave.

 In gnuplot

 set ytics nomirror
 set y2tics
 plot x, x*x axis x1y2

 and this gives me the plot I want

 in octave

 x = 10:10;
 gset ytics nomirror
 gset xrange[10:10]
 gset yrange [10:10]
 plot(x,x,'b')
 hold on
 gset y2tics
 gset x2range[10:10]
 gset y2range [0:100]
 plot(x,x.^2,'r')
 replot

 hold off
 This gets me close, however the yaxis and/or scale is not changed so
 while the tic marks are correct the plot is not. I would appreciate
 any pointers or sugggestions.
If I use an equivalent set of commands directly with gnuplot, I also
get an incorrect plot. Here are the commands I used in gnuplot:
set ytics nomirror
set xrange [10:10]
set yrange [10:10]
plot x
set y2tics
set x2range [10:10]
set y2range [0:100]
replot x**2
and here is the plot it produces:
10 +++#+#+**100
+ + # + # + x ****** +
 # # x**2 ***### 
 # # **** 
 # # *** ++80
5 ++ # # *** 
 # # *** 
 ## ## **** 
 # #**** ++60
 ## *** 
0 ++ ####**** 
 **** 
 *** 
 **** ++40
 **** 
 *** 
5 ++ *** 
 *** ++20
 **** 
 *** 
+ **** + + + +
10 **+++++0
10 5 0 5 10
which I'd guess is not what you want. I'm using gnuplot 3.6beta340.
What version of gnuplot are you using, and what commands give you the
plot you want? If this is a gnuplot bug (and it looks as though it
is) would someone please report it?
Thanks,
jwe