Multiple bode plots fail on same figure
John W. Eaton
jwe at bevo.che.wisc.edu
Tue Aug 26 16:40:38 CDT 2008
On 27-Jun-2008, Anon5710 wrote:
| It an easy to reproduce bug.
| Here's an example.
|
| ********************
| clear all;
| [a1,b1] = butter( 7, [25, 41], 's');
| [a2,b2] = butter( 7, [49, 81], 's');
| bandpass_1 = tf( a1, b1);
| bandpass_2 = tf( a2, b2);
| figure(1);
| clf;
| bode( bandpass_1 )
| hold on;
| bode( bandpass_2 )
| ********************
|
| The resulting figure has the phase plot of both system functions. But it
| only shows the magnitude plot of the last one to given. (in this case
| bandpass_2)
|
| Are there any solutions to this?
|
| I am using GNU Octave, version 3.0.1
| Compiled from source on my gentoo system. (I have instaled the various
| octave-forge-* packages.)
I think this problem is happening because Octave is not handling the
nextplot property correctly for figures (and the hold function is not
even setting it, which I think it should). Here is a simpler example
that demonstrates the problem (no need for butter, tf, or bode):
x = -10:0.1:10;
subplot (2, 1, 1);
plot (x, sin(x));
subplot (2, 1, 2);
plot (x, sin(x));
hold ("on");
subplot (2, 1, 1);
plot (x, cos(x));
subplot (2, 1, 2);
plot (x, cos(x));
I don't know the proper fix for this. I could use some help from
someone who understands just how the nextplot properties for figure
and axes objects are supposed to work.
Thanks,
jwe
More information about the Bug-octave
mailing list