Reputation: 1197
I use a Perl-script to make several graphs through piping a heredoc to Gnuplot (version 4.6 patchlevel 3). I have some problems to define labels in the desired manner. I want to:
sprintf
)I don't know how to define the format specifiers and I also had a look at the label docu1 [link isn't interpreted correctly] label docu2. This post shows a complicated way how to define the box and has to be set for every label.
Sorry for posting not just one exact question, but they are all concerning the labeling style.
My Gnuplot tests so far:
set style line 1 lt 1 lw 1 lc rgb "#FF4500"
set label 1 'Var1 = sprintf("%5.3f",$Var1)' at graph 0.8, graph 0.95 front font 'Times-Roman,10'
plot "file.dat" u 1:2 ls 1
My problems:
ls
(linestyle).Thx in advance!
Upvotes: 1
Views: 2906
Reputation: 48390
Ok, lets see how to get the things sorted:
Using sprintf
works like this:
set label 1 sprintf("Var1 = %5.3f",Var1) at ...
or
set label 1 'Var1 = '.sprintf("%5.3f", Var1) at ...
Boxed labels are supported only in the current development version 4.7. You could misuse the key to get a boxed label (if you don't need it otherwise):
set key opaque box samplen -1 at graph 0.8, graph 0.95 font 'Times-Roman,10'
plot 'file.dat' using 1:2 ls 1 title sprintf('Var1 = %5.3f', Var1)
Upvotes: 1