Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #1983 > unrolled thread

Matrix plotting, sum/average of a sequence of rows?

Started by"Alex van der Spek" <zdoor@xs4all.nl>
First post2013-08-20 14:43 +0200
Last post2013-08-24 12:37 +0200
Articles 4 — 2 participants

Back to article view | Back to comp.graphics.apps.gnuplot


Contents

  Matrix plotting, sum/average of a sequence of rows? "Alex van der Spek" <zdoor@xs4all.nl> - 2013-08-20 14:43 +0200
    Re: Matrix plotting, sum/average of a sequence of rows? "Alex van der Spek" <zdoor@xs4all.nl> - 2013-08-20 18:53 +0200
    Re: Matrix plotting, sum/average of a sequence of rows? sfeam <sfeam@users.sourceforge.net> - 2013-08-21 08:31 -0700
      Re: Matrix plotting, sum/average of a sequence of rows? "Alex van der Spek" <zdoor@xs4all.nl> - 2013-08-24 12:37 +0200

#1983 — Matrix plotting, sum/average of a sequence of rows?

From"Alex van der Spek" <zdoor@xs4all.nl>
Date2013-08-20 14:43 +0200
SubjectMatrix plotting, sum/average of a sequence of rows?
Message-ID<5213645a$0$15872$e4fe514c@news2.news.xs4all.nl>
To plot rows from a matrix:

gnuplot> plot 'foo.txt' matrix using 1:3  every :SKIP::BEG::END with lines

this works well and plots every SKIP rows between BEG and END.

You would think that plotting the sum of those would be

gnuplot> plot 'foo.txt' matrix using (sum [n=BEG:END] column(1)):3 every 
:SKIP::BEG::END with lines

this plots the same as the first though. Likewise, if the sum is done on 
column 3 this plots the same.

Thoughts?
Alex van der Spek 

[toc] | [next] | [standalone]


#1985

From"Alex van der Spek" <zdoor@xs4all.nl>
Date2013-08-20 18:53 +0200
Message-ID<52139eff$0$15920$e4fe514c@news2.news.xs4all.nl>
In reply to#1983
The obvious smooth unique did not produce the desired result either

gnuplot> plot 'foo.txt' matrix using 1:3  every :SKIP::BEG::END smooth 
unique with lines

I am out of thoughts...anyone?
Thanks in advance,
Alex van der Spek

"Alex van der Spek" <zdoor@xs4all.nl> wrote in message 
news:5213645a$0$15872$e4fe514c@news2.news.xs4all.nl...
> To plot rows from a matrix:
>
> gnuplot> plot 'foo.txt' matrix using 1:3  every :SKIP::BEG::END with lines
>
> this works well and plots every SKIP rows between BEG and END.
>
> You would think that plotting the sum of those would be
>
> gnuplot> plot 'foo.txt' matrix using (sum [n=BEG:END] column(1)):3 every 
> :SKIP::BEG::END with lines
>
> this plots the same as the first though. Likewise, if the sum is done on 
> column 3 this plots the same.
>
> Thoughts?
> Alex van der Spek 

[toc] | [prev] | [next] | [standalone]


#1987

Fromsfeam <sfeam@users.sourceforge.net>
Date2013-08-21 08:31 -0700
Message-ID<kv2mgi$bla$1@dont-email.me>
In reply to#1983
Alex van der Spek wrote:

> To plot rows from a matrix:
> 
> gnuplot> plot 'foo.txt' matrix using 1:3  every :SKIP::BEG::END with
> lines
> 
> this works well and plots every SKIP rows between BEG and END.
> 
> You would think that plotting the sum of those would be
> 
> gnuplot> plot 'foo.txt' matrix using (sum [n=BEG:END] column(1)):3
> every
> :SKIP::BEG::END with lines
> 
> this plots the same as the first though. Likewise, if the sum is done
> on column 3 this plots the same.
> 
> Thoughts?
> Alex van der Spek

This limitation has nothing to do with matrices.
Gnuplot read, processes, and plots one line at a time.
There is no mechanism for summing a column, because that would
require accessing all the lines at once.

	Ethan



[toc] | [prev] | [next] | [standalone]


#2002

From"Alex van der Spek" <zdoor@xs4all.nl>
Date2013-08-24 12:37 +0200
Message-ID<52188cf6$0$15947$e4fe514c@news2.news.xs4all.nl>
In reply to#1987
Thanks Ethan,

I figured something along those lines.

I transposed the matrix outside of gnuplot. Then computing the sum/mean is 
easy using the sum function.

Regards,
Alex van der Spek


"sfeam" <sfeam@users.sourceforge.net> wrote in message 
news:kv2mgi$bla$1@dont-email.me...
> Alex van der Spek wrote:
>
>> To plot rows from a matrix:
>>
>> gnuplot> plot 'foo.txt' matrix using 1:3  every :SKIP::BEG::END with
>> lines
>>
>> this works well and plots every SKIP rows between BEG and END.
>>
>> You would think that plotting the sum of those would be
>>
>> gnuplot> plot 'foo.txt' matrix using (sum [n=BEG:END] column(1)):3
>> every
>> :SKIP::BEG::END with lines
>>
>> this plots the same as the first though. Likewise, if the sum is done
>> on column 3 this plots the same.
>>
>> Thoughts?
>> Alex van der Spek
>
> This limitation has nothing to do with matrices.
> Gnuplot read, processes, and plots one line at a time.
> There is no mechanism for summing a column, because that would
> require accessing all the lines at once.
>
> Ethan
>
>
>
> 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.graphics.apps.gnuplot


csiph-web