I want to plot only the first rows of my data file. I can use 'using' to
select which columns to plot but how can select which rows?
My data file looks eg
1 2 3
2 3 4
3 4 5
4 5 6
5 6 7
and I want plot it as if it were
1 3
2 4
3 5
taking only some columns and rows.
TIA
Sebastian
I wanted to do exactly the same thing before. I dont think gnuplot is
capable of doing that. The work around I finally settled upon is to load
the data into a matrix say A and then plot A(1,:) vs A(2,:). If you are
using linux, you can use octave (which in turn uses gnuplot for
graphics) for doing this. If you have money matlab is also an option.
hth
raju
--
Kamaraju S Kusumanchi
http://www.people.cornell.edu/pages/kk288/
http://malayamaarutham.blogspot.com/
plot '< head -3 foo'
>I can use 'using' to
>select which columns to plot but how can select which rows?
>My data file looks eg
>1 2 3
>2 3 4
>3 4 5
>4 5 6
>5 6 7
>
>and I want plot it as if it were
>
>1 3
>2 4
>3 5
>
>taking only some columns and rows.
>
>TIA
>
>Sebastian
--
Ethan A Merritt
help every
--
Hans-Bernhard Broeker (bro...@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
> In article <43ac56a3$0$9647$9b4e...@newsread2.arcor-online.net>,
> Sebastian Schubert <sebastian...@gmx.de> wrote:
>>
>>I want to plot only the first rows of my data file.
>
> plot '< head -3 foo'
>
Nice, do you know a possiblity to select rows 10..134 for example? Couldn't
find a solution.
Thx
Sebastian
> Sebastian Schubert wrote:
>> Hi,
>>
>> I want to plot only the first rows of my data file. I can use 'using' to
>> select which columns to plot but how can select which rows?
>> My data file looks eg
>> 1 2 3
>> 2 3 4
>> 3 4 5
>> 4 5 6
>> 5 6 7
>>
>> and I want plot it as if it were
>>
>> 1 3
>> 2 4
>> 3 5
>>
>> taking only some columns and rows.
>
> I wanted to do exactly the same thing before. I dont think gnuplot is
> capable of doing that. The work around I finally settled upon is to load
> the data into a matrix say A and then plot A(1,:) vs A(2,:). If you are
> using linux, you can use octave (which in turn uses gnuplot for
> graphics) for doing this. If you have money matlab is also an option.
Thx, this is a nice idea as I know octave a bit. The problem is that I don't
like octave's way of using gnuplot. I like to have full control (at least I
have to set terminal to epslatex) and everytime I use gset it wants me to
use __gnuplot_set__. So I get the feeling that I rather should use gnuplot
for plotting.
Sebastian
> Sebastian Schubert <sebastian...@gmx.de> wrote:
>> I want to plot only the first rows of my data file. I can use 'using' to
>> select which columns to plot but how can select which rows?
>
> help every
>
Thx for advice. The probleme is that I actually need to calculate the values
I have to plot by combining several columns (yes, I haven't mentioned
that). It seems to me that I can't use using and every at the same time.
Thx
Sebastian
plot '< head -134 foo | tail +10'
Grüße von
Peter.
Mmmh... I should have seen this myself...
Thx
Sebastian
> Thx for advice. The probleme is that I actually need to calculate the
> values
> I have to plot by combining several columns (yes, I haven't mentioned
> that). It seems to me that I can't use using and every at the same time.
You could use Gnuplot to select the rows it plots by using any formula that
combines many columns.
plot 1:($2*$3 > 5 ? $6 : 1/0) ...
will check if the product of column 2 and 3 is greater than 5. If so, it
will column 6 on y axis; if not, it will make a null value of 1/0 and
therfore not anything.
HTH.
s
> The probleme is that I actually need to calculate the values I have
> to plot by combining several columns (yes, I haven't mentioned
> that). It seems to me that I can't use using and every at the same
> time.
And what made you think that?
gnuplot is a somewhat complex program. You may have to actually read
the documentation to use it.
Just for completeness, I think that something like
plot "foo" using 1:($0 >= 9 && $0 <= 133 ? $2 : 1/0)
should also work.
Lutz