|
From: CLOSE D. <Dav...@us...> - 2009-12-01 19:15:07
|
Steve Cohen wrote: > Having recently swum in these same shark-infested waters myself (I am > not a developer of this project, just a user like you) I would first > get rid of > set xdata time > set timefmt "%Y-%m" > set format x "%m\\n%Y" > > Histograms and these time functions simply don't mix. At all. Thank you to both Steve and Hans-Bernhard for that. I wonder if this would merit mention in the manual? > You will, of course, then, not see labels on your x-axis, but you > should at least see a graph. > > Now, for those x-axis labels, Gnuplot's string functions are your > friend: > > plot "/tmp/file" using > 2:xtic(substr(stringcolumn(1),6,7)\\nsubstr(stringcolumn(1),1,4), > "/tmp/file" using ($3+$4+$5+$6+$7) > axis x1y2 Thank you, Steve. I was in the process of researching how to get the labels I need when your note dramatically shortened my effort. But I did need to change your suggestion slightly. 1. Your parentheses weren't balanced (easy to fix). 2. \\n doesn't work in that place. I had to change it to '."\n".'. That is, put it in quotes and use string concatenation. I could also have used sprintf but that takes more characters to type. 3. I had to add "bmargin 3" so the second line of label would actually appear. Dave Close |