I tried switching off some titles by substituting the command 'title' with 'notitle', but this seems to fail when the title is generated by a function:
mytitle(n) = 'my test title nr '.n
plot x title mytitle(1)plot x notitle mytitle(1)
On Ubuntu 12.04, gnuplot 4.6.4 says to the 2nd plot command
';' expected
and cvs head
unexpected or unrecognized token
When 'mytitle' is a simple string constant, there is no problem.
Now fixed (I think) in 4.7
It turns out to be harder than expected to fix this because the "function" may not really be a function call at all. Consider this line from the demo script iterate.dem:
plot for [n=2:10] sin(x*n)/n notitle lw (13-n)/2
If we tell the program that a function is legal following notitle but should be ignored, then it mistakes lw(...) for a function. At that point it either complains that lw has not been defined or consumes and then ignores it, neither of which is the desired outcome.
Thanks, my original problem is solved in 4.7
However, the issue you mentioned is actually unexpectedly problematic, I agree ... and it seems not to be solved definitely. If I use the demo line you mentioned now in 4.7:
I get the nice plot. When I define
I get the same plot incl. the proper linewidths, but when I type
the subsequent plot command complains with
.
help strings says:
Maybe it makes sense to apply this rule to functions as well? I.e., elements on the command line are evaluated as possible (user defined) functions only if they are not recognizable gnuplot syntax?
That would be nice, but I'm afraid the syntax is too open-ended for that to be an easy task.