Newb question

10 views
Skip to first unread message

David Partridge

unread,
Sep 7, 2021, 7:04:45 AM9/7/21
to
I tried to find this out from the "friendly manual", but failed - too overwhelmed by information.

I want GNUPlot to process a CSV whose 1st record provides "metadata" about the remainder of the data in the file (test conditions to be added as annotations to the plot).

Is this easy to do? If so a pointer to a working example or tutorial for this would be hugely helpful.

Thanks
David

Olaf Schultz

unread,
Sep 7, 2021, 7:51:40 AM9/7/21
to
Moin, perhaps

try it with "with labels"

http://gnuplot.sourceforge.net/demo/

espacially

http://gnuplot.sourceforge.net/demo/datastrings.html

is a good hint for you.

Greetings,

Olaf

David Partridge

unread,
Sep 8, 2021, 4:12:00 AM9/8/21
to
Not really as there wasn't any explanation of what was happening. Lets try this with a different approach. What if the first record is a comment line and therefore csv metadata.

Is there a way to get GNUPlot to display that comment line as a caption?

D.

Jörg Buchholz

unread,
Sep 9, 2021, 3:51:36 AM9/9/21
to
Hi David

as a example, if your datafile is something like this and named "data.dat":

This is the title
1 2
1 3
1 4
1 5
2 1


Than you can do the following and you have a plot with "This is the
title" as the title.

set datafile separator ";"
set term unknow
plot 'data.dat' every ::0::0 using (textVar=stringcolumn(1),0)
set title textVar
set datafile separator whitespace
set term qt
plot 'data.dat' skip 1 u 1:2

Jörg
Reply all
Reply to author
Forward
0 new messages