|
From: Ethan M. <merritt@u.washington.edu> - 2010-03-07 01:40:08
|
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
For the cairo terminals, it seems a bit late in the day to change
things for 4.4.0 but we can look at it after the release. Probably
we should expose all three options to the user. We could do that
for post.trm also.
Ethan
> (Or maybe a better question is, is there a better way of doing
> what I'm trying to do?)
|