|
From: Joce <Jo...@gm...> - 2009-11-30 12:49:15
|
Hello I'm producing a series of different plots in eps format, which have the same aspect ratio but different values for the y-axis tic labels. I'd like to have them all with the same size, that is, that the plot itself has the same size, regardless of the width of the tic labels. I've tried adjusting the lmargin, but it seems to me there's a further scale change when the eps is produced, such that the width of the actual eps plot incl labels fits in the page. How's it possible to override this scale change? Best wishes -- View this message in context: http://old.nabble.com/eps-output-magnification-tp26574175p26574175.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |
|
From: CLOSE D. <Dav...@us...> - 2009-11-30 19:18:10
|
Using the latest release 4.4.0-rc1:
set boxwidth 0.8 relative
set xdata time
set timefmt "%Y-%m"
set format x "%m\\n%Y"
set ylabel "label1"
set y2label "label2"
set ytics nomirror
set y2tics nomirror
set key off
set style fill solid 1.0
set boxwidth 0.9 relative
set style histogram clustered
set style data histograms
set style fill solid 1.0 border -1
plot "/tmp/file" using 2:xtic(1), "/tmp/file" using ($3+$4+$5+$6+$7)
axis x1y2
^
Need full using spec for x time data
(I understand that some of the settings may not be optimal. For example,
the boxwidth. I would expect to tune these once I see some output.)
A little searching hints that this message may be somewhat misleading.
That what it really means is that a "format" must be added. But perhaps
that hint is wrong? I've tried adding '%lf', '%lf-%lf', and '%lf-%lf
%lf' but the error persists.
Can anyone tell me the right way to generate this plot?
Dave Close
|
|
From: CLOSE D. <Dav...@us...> - 2009-11-30 22:54:55
|
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 |
|
From: Hans-Bernhard B. <HBB...@t-...> - 2009-11-30 23:16:57
|
CLOSE Dave wrote: > 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. Of course you do. You already have too _few_ using specifiers to work with 'set xdata time'. Removing more obviously won't help with that. > 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. As I said, histogramming and date/time input don't make sense together. Drop the 'set xdata time' entirely and you should get a plot. |
|
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.) |
|
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 |
|
From: Steve C. <sc...@ja...> - 2009-12-01 22:33:07
|
CLOSE Dave wrote: > 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 > > > ------------------------------------------------------------------------------ > 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 > > Heh, I'm a relative newbie myself and I thought my concatenation was weak, but I didn't see an explicit concat() function, but I decided to send it anyway and so you've gone me one better and taught me something. In my similar example I was able to take a substring of the date as a whole without needing to concatenate the pieces. If your source is a database query you might consider rewriting it if you can to avoid such ugliness. another trick for the x labels is set xtics nomirror out rotate by -45 which outputs the labels diagonally so you can squeeze more in. Don't know if that would work for you. Steve |