|
From: Allin C. <cot...@wf...> - 2007-12-13 14:50:30
|
On Mon, 10 Dec 2007, Ethan Merritt wrote: > On Monday 10 December 2007 04:50, Allin Cottrell wrote: > > set xrange [-100000:100000] > > plot x > > > > Using term pngcairo font "Vera,8" (just for example) the last > > x-axis value is displayed as (almost) "10000". Part of the last > > printed zero is off the edge of the graph, and the final zero is > > entirely missing. > > You are correct. Gnuplot does not pay any attention to tick labels > when allocating space for the plot. That would be quite difficult, > since the precise space taken up by a text string is terminal- and > font- dependent. It is particularly problematic for text strings > placed at an angle other than 0. But I suppose it could make at > least a rough guess. OK, I understand this is quite tricky in general. But things have regressed in this respect since 4.2. This script set term png font Vera 8 set output 'foo.png' set xrange [-100000:100000] plot x produces correct output with 4.2 (i.e. the "100000" marker is fully visible) but shows truncated output with current CVS. Comparing the two plot files, the margin between the right-hand vertical border line and the edge of the PNG image was greater by a few pixels in 4.2, hence allowing the full marker string to come through. The contrast remains the same if you bump up the font size to something that's really "too big", e.g. Vera 16. Ah, and at that scale you can see something else: the trouble seems to be that all of the "data ink" is displaced to the right in CVS relative to 4.2: the right-hand margin is too small, and the left-hand margin is too big (a lot of pixels of white space). I'd be happy to try patching, but it seems to me that someone who's more familiar with gnuplot development might have a better idea where to look for the source of this change in behavior. Allin Cottrell |