help-octave
[Top][All Lists]
Advanced

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

Re: Plotting question


From: Dominique Michel
Subject: Re: Plotting question
Date: Mon, 26 Mar 2007 09:01:38 +0200

Le Mon, 26 Mar 2007 16:39:46 +0200,
David Bateman <address@hidden> a écrit :

> David Bateman wrote:
> > Dominique Michel wrote:
> >   
> >> Le Mon, 26 Mar 2007 15:32:16 +0200,
> >> David Bateman <address@hidden> a écrit :
> >>
> >>   
> >>     
> >>> Dominique Michel wrote:
> >>>     
> >>>       
> >>>> Hi all,
> >>>>
> >>>> I am new with Octave and have a problem with the plot function. My system
> >>>> is: gentoo gnu-linux with octave-2.1.73
> >>>>
> >>>> I am trying to do a little octave program that will automatise a little
> >>>> the creation of spice vacuum tube models based on the constant current
> >>>> characteristic.
> >>>>
> >>>> All my program is doing for now (I started yesterday with Octave) is to
> >>>> put a first set of curves in a data structure and try to plot them:
> >>>>
> >>>>
> >>>>   
> >>>>       
> >>>>         
> >>> Try "plot (a.a.a(:,1),a.a.a(:,2))", giving "plot" a matrix and it treats
> >>> as two curves (as does matlab)
> >>>
> >>> D.
> >>>
> >>>
> >>>     
> >>>       
> >> Thank you, it work. I try with
> >>
> >> xlabel "Ua"
> >> ylabel "Ug1"
> >> title "Ug1=f(Ua); Ug2=300V"
> >> grid
> >> mplot
> >> (a.a.a(:,1),a.a.a(:,2),a.a.b(:,1),a.a.b(:,2),a.a.c(:,1),a.a.c(:,2),a.a.d(:,1),a.a.d(:,2),a.a.e(:,1),a.a.e(:,2),a.a.f(:,1),a.a.f(:,2))
> >>
> >> and the result is just what I want for now.
> >>
> >> BTW, I never used matlab either. I choose Octave because it seemed more
> >> logical to me to use a math program as a spreadsheet for such a work. And
> >> also because Octave seem to have a good matlab compatibility and it can be
> >> useful to me to learn some of Octave basis anyway.
> >>
> >> I have one more question. Is it possible to give a title to the 6 lines I
> >> get on the graph? something as "Ia=28 mA" for line 1 and so on until
> >> "Ia=192 mA" for line 6.
> >>
> >>   
> >>     
> > In matlab syntax you'd use the "legend" function to add the titles. This
> > works correctly in the CVS, but has a few issues in 2.1.73 you are
> > using.. The alternative octave specific way of doing it is something like
> >
> > plot (a.a.a(:,1),a.a.a(:,2),';;Ia=28mA',a.a.b(:,1),a.a.b(:,2),';;Ia=192mA')
> >
> > D.
> >
> >
> >   
> Sorry that should have read
> 
> plot (a.a.a(:,1),a.a.a(:,2),';Ia=28mA;',a.a.b(:,1),a.a.b(:,2),';Ia=192mA;')
> 
> D.
> 

Thank you, after some try and retry, I get it to work.

mplot  
(a.a.a(:,1),a.a.a(:,2),';Ia=28mA;',a.a.b(:,1),a.a.b(:,2),';Ia=52mA;',a.a.c(:,1),a.a.c(:,2),';Ia=76mA;',a.a.d(:,1),a.a.d(:,2),';Ia=105mA;',a.a.e(:,1),a.a.e(:,2),';Ia=140mA;',a.a.f(:,1),a.a.f(:,2),';Ia=192mA;')

It seem at "help plot" is wrong:
`";title;"'
          Here `"title"' is the label for the key.

I get a syntax error with ` at the beginning, and more syntax errors with the ".

Cheers,
Dominique



reply via email to

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