[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
subplot question between 2,1.xx and 2.9.12
From: |
Tatsuro MATSUOKA |
Subject: |
subplot question between 2,1.xx and 2.9.12 |
Date: |
Mon, 16 Jul 2007 12:56:10 +0900 (JST) |
The following simple code
*****************
subplot(111);clg;
%
x=linspace(0,3*pi,301);
subplot(211);
xlabel("x \n");
ylabel("sin(x)\n");
axis([0 2*pi -1.1 1.1]);
plot(x,sin(x));
%
subplot(212);
xlabel("x \n");
ylabel("cos(x)\n");
axis([0 2*pi -1.1 1.1]);
plot(x,cos(x));
**********************
give the graph on octave 2.1.50 (cygwin)
http://www.geocities.jp/tmacchant/Files/sbptest1.png
but the same code on octave 2.9.12 on MCVC
give the graph
http://www.geocities.jp/tmacchant/Files/sbptest2.png
The label and axis setting is ignored.
Instead of the above code
************************
subplot(111);clg;
%
x=linspace(0,3*pi,301);
subplot(211);
plot(x,sin(x));
xlabel("x \n");
ylabel("sin(x)\n");
axis([0 2*pi -1.1 1.1]);
drawnow;
%
subplot(212);
plot(x,cos(x));
xlabel("x \n");
ylabel("cos(x)\n");
axis([0 2*pi -1.1 1.1]);
drawnow;
****************************
gives the graph like
http://www.geocities.jp/tmacchant/Files/sbptest3.png
However, in this case, the octave 2.1.50 gives the graph
http://www.geocities.jp/tmacchant/Files/sbptest4.png
So I have to write a script for the both octave version
being consistent like following
****************************
subplot(111);clg;
%
x=linspace(0,3*pi,301);
subplot(211);
xlabel("x \n");
ylabel("sin(x)\n");
axis([0 2*pi -1.1 1.1]);
plot(x,sin(x));
xlabel("x \n");
ylabel("sin(x)\n");
axis([0 2*pi -1.1 1.1]);
drawnow;
%
subplot(212);
xlabel("x \n");
ylabel("cos(x)\n");
axis([0 2*pi -1.1 1.1]);
plot(x,cos(x));
xlabel("x \n");
ylabel("cos(x)\n");
axis([0 2*pi -1.1 1.1]);
drawnow;
******************************
However the code seems to be curious. I would like to
avoid such ugry code. Does anyone know a good idea for
smart coding ?
--------------------------------------
Easy + Joy + Powerful = Yahoo! Bookmarks x Toolbar
http://pr.mail.yahoo.co.jp/toolbar/
- subplot question between 2,1.xx and 2.9.12,
Tatsuro MATSUOKA <=