|
From: Allin C. <cot...@wf...> - 2010-03-07 03:18:33
|
On Sat, 6 Mar 2010, Ethan Merritt wrote:
> On Saturday 06 March 2010, Allin Cottrell wrote:
>
> > But the problem is that
> > setting the linewidth to 30 (to represent the duration of the
> > recession) also causes the ends of the lines to be extended, top
> > and bottom, so they spill out of the graph area. (For terms = png,
> > pngcairo, pdfcairo, at least.)
> >
> > My first reaction is that setting a fat linewidth should not
> > affect the length of the line, but is there some reason why it
> > does so?
>
> This is the convention established by PostScript and followed by
> many other vector-drawing languages. Lines are drawn as if by
> a pen with a flat, round, or square nib. In the latter two cases
> each line segment is extended by the radius of the nib.
> The corresponding PostScript commands are {0|1|2} setlinecap.
> The corresponding cairo properties are BUTT, ROUND, and SQUARE.
>
> Gnuplot's "set terminal" commands accept "rounded" and "butt" as options.
> Confusingly, the cairo terminal's "butt" option is translated into
> CAIRO_LINE_CAP_SQUARE rather than CAIRO_LINE_CAP_BUTT.
>
> This can be considered a bug :-)
>
> Anyhow, for postscript and for the libgd-based png terminal you should be
> able to get what you want by saying, for example,
> set term png butt
Thanks, and Yes, I get that with libgd-png. In fact I get no
spillover with "set term post eps" (without adding "butt") but the
appearance of the gray bar is not good: it has horizontal stripes.
However, I've come to a better way to control the recession bars,
namely by adding the peaks and troughs as data and plotting them
using 1:2:3 with filledcurve.
Allin Cottrell
|