I have a problem with setting the x and ytics in gnuplot. I want to create heat maps, and to do it I need specific tics for each "block" in them. I want to create them with loops, so it is much easier to work with them, because for instance I need to make like 60 xtics so I have to write down this:
set xtics ("-0.3" 0, "-0.29" 1, ... "0.3" 60)
It is exhausting and frustrating, so I wanted to make a script like this:
xnumtics = 60
ynumtics = 90
set macros
xticstring = '('
do for [i=0:xnumtics] {
xticstring = xticstring.'"'.(-0.3 + i*0.01).'" '.i.', '
}
xticstring = xticstring.'"'.0.3.'" '.xnumtics.')'
set xtics @xticstring
yticstring = '('
do for [j=0:ynumtics] {
yticstring = yticstring.'"'.(0 - i*0.01).'" '.j.', '
}
yticstring = yticstring.'"'.0.9.'"'.ynumtics.' '
set ytics @yticstring
Unfortunately I get an error: line 21: internal error : STRING operator applied to non-STRING type
line 21 refers for: xticstring = xticstring.'"'.(-0.3 + i*0.01).'" '.i.','
I got this idea from: Can GNUPLOT dynamically prepare index labels?
I am using gnuplot 4.6 ptchlvl 4 on ubuntu 14.04 LTS
Sorry if it is too trivial, I cannot figure it out what is the problem...
Thank you!