help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 2 Y-axes in the same figure


From: Eduardo J. Adam
Subject: Re: 2 Y-axes in the same figure
Date: Fri, 21 Oct 2011 09:38:11 -0300

Thanks again Michael,
1. One of my problem is the command set. I was reading about that and the syntaxes is,

set(h,attr,val)

I'm looking for a a list or table with different attribute and values for this command and I don't find it.
Did you know a web page or whatever for that?

2. Other problem is the command plotyy. I think but I'm not sure that, it is impossible with this command to do multiple plot in the same figure. For example command plot with hold on you can draw a new figure over the previous figure. I think this option is not possible with plotyy. That is,

plotyy
hold on
plotyy

dosn't work.

Thanks.
Eduardo



On Oct 20, 2011, at 3:24 PM, Eduardo J. Adam wrote:

Dear friends,
It's me again.
Well,
after my last visit I have made ​​great progress with my octave code
. But, actually I have a new question.
The following code works very well for me.

clear all, clf
K=1; n=K; d=[1 0.2 1 0];
gs=tf(n,d);
[mag_gs,pha_gs,w]=bode(gs);
mag_gs_db=20*log(mag_gs);
h = plotyy(w,mag_gs_db,w,pha_gs);
set (h, 'xscale', 'log','xminortick', 'on'); grid

The problem appears when I try to plot again because I need to plot 2 or 3 times in different steps. For example, if I write
K=20; n=K; d=[1 0.2 1 0];
gs=tf(n,d);
[mag_gs,pha_gs,w]=bode(gs);
mag_gs_db=20*log(mag_gs);
h =plotyy(w,mag_gs_db,w,pha_gs);
set (h, 'xscale', 'log','xminortick', 'on'); grid

the semilogx scale desappear. Here, I include two figure that shows the problem.


<image.png><image.png>


error: addproperty: a `__plotyy_axes__' property already exists in the graphics
object
error: called from:
error: /usr/share/octave/3.2.4/m/plot/plotyy.m at line 193, column 1
error: /usr/share/octave/3.2.4/m/plot/plotyy.m at line 111, column 1
error: /home/eadam/Desktop/example2.m at line 17, column 3

I don't know what the function tf is and I'm not entirely sure I understand your question, but I think what you want to do is:
1. Enter the command:
h =plotyy(w,mag_gs_db,w,pha_gs);
   only once. For subsequent curves, just use plotyy(w, ,,  without the h =. The dependent variable name should change with each curve.
2. Enter the command
 set (h, 'xscale', 'log','xminortick', 'on'); grid
only once.



--

Dr. Eduardo J. Adam
Prof. Adjunto Instrumentación y Control de Procesos
Facultad de Ingeniería Química
Santiago del Estero 2654, (S3000AOJ), Santa Fe, SF, Argentina
Tel. +54 (0342) 457-1167 Int. 2742
http://www.fiq.unl.edu.ar/control/index.php?page=adam


reply via email to

[Prev in Thread] Current Thread [Next in Thread]