Adding a line to gnuplot autostart

I use the gnuplot scrip command set key autotitle columnheadto make tables for my data. The only problem is that the column header data is numeric, and therefore it really doesn't really matter much by itself.

Is there a way to add a fixed line to autorun, for example "Year " + columnhead, or, alternatively, give my key a heading?

+4
source share
1 answer

Concatenating strings using the .c operator columnhead()works in gnuplot v4.6 ( documentation ):

set terminal pngcairo enhanced truecolor size 480,320 fontscale 0.8
set output 'autotitle.png'
set key left Left

plot for [i=2:4] 'data.txt' u 1:i w l t 'f(x) = '.columnhead(i)

gnuplot output

, , , : set key title 'f(x)'.

data.txt, :

x 100x x^3 2^x
1 100 1 2
2 200 8 4
3 300 27 8
4 400 64 16
5 500 125 32
6 600 216 64
7 700 343 128
8 800 512 256
9 900 729 512
10 1000 1000 1024
+2

Source: https://habr.com/ru/post/1619696/


All Articles