help-octave
[Top][All Lists]
Advanced

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

Re: problem with subplot


From: Henry F. Mollet
Subject: Re: problem with subplot
Date: Tue, 22 Feb 2005 15:08:10 -0800
User-agent: Microsoft-Entourage/10.1.1.2418

I tried your code again, with my workspace back to about where it had been,
had the same problem with only subplot on the right. The subplot on the left
was not even drawn, vs. drawn and then "clearplotted", the left part of the
window remained blank. Below are the errors that I got but I don't know what
it all means:
G N U P L O T
        Version 3.8i patchlevel 0
GNU Octave, version 2.1.46 (powerpc-apple-darwin6.6).
Henry

octave:7> x=linspace(0,6);
octave:8> for i=1:4
>  y(i,:)=cos(i*x);
> end
error: A(I, J) = X: X must be a scalar or the number of elements in I must
error: match the number of rows in X and the number of elements in J must
error: match the number of columns in X
error: assignment failed, or no method for `matrix = matrix'
error: evaluating assignment expression near line 9, column 8
error: evaluating for command near line 8, column 1
octave:8> subplot(1,2,1);
octave:9> plot(x,y(1,:),';x=1;');
error: __plt2vv__: vector lengths must match
error: evaluating if command near line 55, column 3
error: called from `__plt2vv__' in file
`/sw/share/octave/2.1.46/m/plot/__plt2vv__.m'
error: evaluating if command near line 51, column 5
error: evaluating if command near line 46, column 3
error: called from `__plt2__' in file
`/sw/share/octave/2.1.46/m/plot/__plt2__.m'
error: evaluating if command near line 57, column 11
error: evaluating if command near line 52, column 9
error: evaluating while command near line 47, column 7
error: evaluating if command near line 28, column 3
error: called from `__plt__' in file
`/sw/share/octave/2.1.46/m/plot/__plt__.m'
error: called from `plot' in file `/sw/share/octave/2.1.46/m/plot/plot.m'
octave:9> hold on
octave:10> plot(x,y(2,:),';x=2;');
error: invalid row index = 2
error: evaluating argument list element number 2
octave:10> plot(x,y(3,:),';x=3;');
error: invalid row index = 3
error: evaluating argument list element number 2
octave:10> plot(x,y(4,:),';x=4;');
error: invalid row index = 4
error: evaluating argument list element number 2
octave:10> title('Funktionen y=cos(kt)');
octave:11> hold off
octave:12> subplot(1,2,2);
octave:13> x=linspace(0,20);
octave:14> plot(x,exp(-x/4));
octave:15> hold on;
octave:16> plot(x,exp(-x/4).*sin(x));
octave:17> title('f(x)=exp(-x/4)sin(x)');
octave:18> text(5,0.38,'exp(-x/4)');
octave:19> hold off;
octave:20> 
 


on 2/22/05 1:38 PM, Gunnar at address@hidden wrote:

>> *However*, at first I got only one subplot on the right as claimed. I had
>> to use *clear all* first to get rid of everything I had in the workspace
>> and then it worked.
>> Henry
> Thanks! That worked.
> Now, any clues about what might have been the acctual problem?
> The problem is that clear all removes all my variabels. Well, I use an m-file
> and knows how to save the variabels so it's not a big deal, but it would be
> interesting to know exactly what caused it.
> 
> Someone also mentioned that
> "I'm plotting in the Matlab way (plot the data
> then annotate) rather than the gnuplot way (set up everything about
> the appearance of the graph, then plot the data)."
> So I should start with title, axis, command firsts, before the plots?
> 
> Gunnar.
> 
> 
> 
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
> 
> Octave's home on the web:  http://www.octave.org
> How to fund new projects:  http://www.octave.org/funding.html
> Subscription information:  http://www.octave.org/archive.html
> -------------------------------------------------------------
> 



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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