Thursday, June 16. 2011

Gnuplot: 'illegal month'

I've recently stumbled across the following error message of Gnuplot:

illegal month

Gnuplot can handle time data. With set timefmt, you can specify the format of your time data. As of know, all your time data has to be in the same format, that is, all columns containing time data must have the same format.

Although every column used the same format, I still got this error message. Strangely enough, if I tested the plot command within gnuplot, the error message disappeared; only when I ran the script to plot the data the error message appeared.

Turns out that the reason for the error message is not a malformed data line, but a malformed command. In my case, I have used the wrong format for specifying the coordinates of set arrow, because I wrote the script with time data that had a different format. Changing the coordinates to adhere to the new time format made the error message disappear.