[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Datablocks, gnuplot "every", plot using row identifier?
From: |
Paul Kienzle |
Subject: |
Re: Datablocks, gnuplot "every", plot using row identifier? |
Date: |
Fri, 13 Feb 2004 23:36:50 -0500 |
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
-------------------------------------------------------------