help-octave
[Top][All Lists]
Advanced

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

Re: Datablocks, gnuplot "every", plot using row identifier?


From: Henry F. Mollet
Subject: Re: Datablocks, gnuplot "every", plot using row identifier?
Date: Sun, 15 Feb 2004 16:25:47 -0800
User-agent: Microsoft-Entourage/10.1.1.2418

Great, I've downloaded 'scatter.m' and then 'unique.m' (is needed in
scatter.m)  and tried the example for a start.

The example worked as expected but the size of the example plot was 0.5 x
1.0 and I could not find where it was set and gshow size did not agree with
the size of the plot.
octave:4> gshow size
octave:5> 
        size is scaled by 1,1
        No attempt to control aspect ratio
gset size did not seem to work in subsequent plot statements.

By trial and error I got my script to work:
I first commented out the axis statements in scatter.m and renamed it
"myscatter.m" but I still had a problem with the size of the plot.  I
finally got what I wanted my putting  myscatter.m first and then use hold on
and subsequent statement to fix the size of the plot. The third plot
statement (now replaced by myscatter.m appeared at the end and is now
commented out (see below).
Thanks, Henry  

Statements for first of about 20 plots:
gset term aqua (100)
gset nokey
gset size 0.95, 0.95
gset origin 0.0,0.05

myscatter (Results(:,8),Results(:,9),0,InputData(:,8),"x")
% needs to be upfront for unknown reasons
% axis statement in scatter.m was commmented out and renamed "myscatter.m"

hold on
grid ('on')     % need () in Octave!?
axis ([0,1.2,0,1.2], "square");

% Cut 3 gset label and 1 title statement

plot (TriangleCorners(:,1),TriangleCorners(:,2), "3")
%hold on  % hold on appearing after first original plot statement
plot (TriangleContours(:,1),TriangleContours(:,2), "0")

% plot (Results(:,8),Results(:,9),"x")
% original plot statement doing the "work" and giving same color for all
data points

hold off
gset nolabel
axis;







on 2/13/04 8:36 PM, Paul Kienzle at address@hidden wrote:

> You could use scatter(X,Y,[],C) from octave-forge,
> where C is a color index.  Values in C depend on
> the particulars of the gnuplot device, but I believe
> they are in the range 1:6.
> 
> The heart of the code looks like:
> 
> for color = unique(c)
>  i =  (color == c);
>  plot(x(i), y(i), sprintf(";;%d%s",color,marker));
> endfor
> 
> Paul Kienzle
> address@hidden
> 
> On Feb 13, 2004, at 10:49 PM, Henry F. Mollet wrote:
> 
>> I'd like to plot two column vectors (or could be a column vector
>> "against"
>> a number of columns in a matrix) and use an identifier for the
>> selection of
>> different symbols and/or colors in different datablocks. For example,
>> first
>> 10 row datapoint to be red (according to ID = 1), next 10 rows
>> datapoints to
>> be blue (according to ID = 2) etc.
>> 
>> In gnuplot, I believe this could be accomplished using "every":
>> plot 'file' every :::0::0 (data in block 1)
>> replot
>> plot 'file' every :::1::1 (data in block 2)
>> When I tried "every' in octave I did not work but it works in gnuplot.
>> (In gnuplot blocks are separated by blank records which octave doesn't
>> allow?)
>> 
>> In Octave, if I use
>> plot (myColVector ,MyMatrixWithSay3Cols)
>> then I'll get 3 curves with 3 different colors by default.
>> What I need is 3 different colors when I use
>> Plot (myColVector1, myColVector2, "ColorAccToIDorBlock')
>> where the two colVectors are somehow divided up into datablocks or
>> labeled
>> by a identifer (could be color identifier, 1 for red, 2 for green, 3
>> for
>> blue).
>> 
>> How do I do this. Sorry for not being able to better describe it.
>> Henry
>> 
>> 
>> 
>> -------------------------------------------------------------
>> 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
> -------------------------------------------------------------



-------------------------------------------------------------
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]