[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnuplot-info
Subject:    Re: string from file to label
From:       thopmanNOSPAM () uoguelph ! ca (Theo Hopman)
Date:       1999-07-09 13:10:40
[Download RAW message or body]

: I want to read a string from a file and place it into a gnuplot label. The
: reason is that I have lots of data files, each of them characterised by a
: title in accompanying datatitle files; and I want to read these titles out
: of the datatitle files and write them into the gnuplot label.

: something like
:   gnuplot<<EOF
:   set label <transfer a string from datatitle file here to>
:   plot "data file"
:   ...
:   EOF

You will have to use an external tool to extract the text from the 
datafile, since gnuplot doesn't really know about strings. That said, the 
external tool can be anything you want; just enclose the command in back 
quotes, and gnuplot will use whatever the command writes to stdout. For 
example:

set label `echo \"$USER\"` at 1,1
show label

results in

label 2 "thopman" at (1, 1, 0) left not rotated  back

You do have to be careful with quotation marks.

THeo

.
 - -
[[[[ to unsubscribe from info-gnuplot, send an email with body
unsubscribe info-gnuplot
to majordomo@dartmouth.edu
]]]]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic