|
From: Steve C. <sc...@ja...> - 2009-12-01 14:20:30
|
CLOSE Dave wrote: > Hans-Bernhard Bröker wrote: > >>> A little searching hints that this message may be somewhat misleading. >>> That what it really means is that a "format" must be added. >> Where your searching let you think you found this, it's wrong. >> >> The error message means exactly what it says: you don't have sufficient >> 'using' specifiers. It makes little sense to mix >> xticlabels/histogramming with time/date features. The former treat the >> input as strings without any numerical meaning by design, the latter is >> a means of extracting a numerical meaning out of human-readable >> date/time strings. So I think you should just forget about 'xdata time' >> and plot your input as it is. > > Thanks for the reply. > > My code says, > plot "/tmp/file" using 2:xtic(1), "/tmp/file" using ($3+$4+$5+$6+$7) axis x1y2 > I've tried it without the :xtic(1) and still get the error. The help screen for "set style histogram" says, "Each element of the `plot` command must specify a single input data source (e.g. one column of the input file), possibly with associated tic values or key titles", so I have trouble understanding what additional using specifier I could add. > > The data file looks like this: > 2009-01 1 1 0 0 0 0 > 2009-02 1 1 0 0 0 0 > 2009-03 3 9 0 0 0 0 > 2009-04 6 6 0 0 3 4 > 2009-05 11 14 3 3 0 4 > 2009-06 10 2 18 7 4 5 > 2009-07 12 18 31 7 6 13 > 2009-08 10 10 37 6 9 22 > 2009-09 14 25 45 8 13 24 > 2009-10 16 19 47 18 16 3 > 2009-11 14 24 29 7 6 3 > > I supposed I could drop the year and plot against the month -- for now. But this won't work once the file contains two more lines, as it will in little more than a month. > > Can you suggest the actual commands needed? > > Dave Close > > > ------------------------------------------------------------------------------ > Join us December 9, 2009 for the Red Hat Virtual Experience, > a free event focused on virtualization and cloud computing. > Attend in-depth sessions from your desk. Your couch. Anywhere. > http://p.sf.net/sfu/redhat-sfdev2dev > _______________________________________________ > Gnuplot-info mailing list > Gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-info > > 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. 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 should get you what you need. (I don't see this documented anywhere but Gnuplot's substring() function appears to use 1-based indexing.) |