Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

718 views
Skip to first unread message

Alex van der Spek

unread,
Aug 20, 2013, 8:43:00 AM8/20/13
to
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

Alex van der Spek

unread,
Aug 20, 2013, 12:53:10 PM8/20/13
to
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" <zd...@xs4all.nl> wrote in message
news:5213645a$0$15872$e4fe...@news2.news.xs4all.nl...

sfeam

unread,
Aug 21, 2013, 11:31:28 AM8/21/13
to
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




Alex van der Spek

unread,
Aug 24, 2013, 6:37:34 AM8/24/13
to
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" <sf...@users.sourceforge.net> wrote in message
news:kv2mgi$bla$1...@dont-email.me...
0 new messages