[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Plotting question
From: |
David Bateman |
Subject: |
Re: Plotting question |
Date: |
Mon, 26 Mar 2007 16:38:16 +0200 |
User-agent: |
Thunderbird 1.5.0.7 (X11/20060921) |
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.
--
David Bateman address@hidden
Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob)
91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax)
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary