|
From: Ethan M. <merritt@u.washington.edu> - 2011-03-14 04:36:28
|
On Sunday, March 13, 2011, Daniel J Sebald wrote: > On 03/12/2011 01:09 PM, Daniel J Sebald wrote: > > On 03/12/2011 12:36 PM, Ethan Merritt wrote: > >> On Saturday, March 12, 2011, Daniel J Sebald wrote: > > >>> A second issue is that the left margin no longer works properly. Try > >>> the 'key.dem' demo and it should be apparent. There are some other > >>> demos where the plot edge for the left margin is not computed correctly. > >> > >> I haven't found any where the left margin of the plot itself is incorrect. > >> The placement of the key box is non-obvious or incorrect in some of the > >> examples. Not sure whether this is because it's mis-estimating to left > >> margin or the font size or what. > > > > This issue is still present. It must have come about before 4.4. > > > > Check the example with "Key (out vert left top)" as a title of the > > upper-left sub-plot. The key used to be outside the actual sub-plot, > > but the sub-plot margin is too small. It should look like a mirror of > > the example "Key (out vert right top)". > > I think it is this change: > > http://gnuplot.cvs.sourceforge.net/viewvc/gnuplot/gnuplot/src/graphics.c?r1=1.316&r2=1.317 > > specifically the green line added at the start of the diff list. I > commented out that line and the key demo works as I remember. I take it you are refering to addition of the line plot_bounds.xleft = xoffset * t->xmax; It looks to me that the program flow is currently - preliminary calculation of xleft, xbot, etc - calculation of key box size - add key box size where needed - calculation of tic label sizes - recalculate xleft, xbot, etc now using the tic label sizes - oops the key box wasn't added in again It may be that the key box size has to be added in twice, once for the preliminary calculation and once for the final calculation. Or it may be that it only has to be included in the final calculation, whereas right now it is only included in the preliminary calculation. I'm not sure which fix is correct. Ethan > > plot_bounds.xleft is adjusted to leave space for the key before the > lines in this diff list. What was the above modification meant to > address? Maybe there is some other way of doing this. > > Before the adjustment for the key, plot_bounds.xleft is set as follows: > > /*{{{ preliminary plot_bounds.xleft, needed for "under" */ > if (lmargin.scalex == screen) > plot_bounds.xleft = lmargin.x * (float)t->xmax; > else > plot_bounds.xleft = xoffset * t->xmax > + t->h_char * (lmargin.x >= 0 ? lmargin.x : 1); > /*}}} */ > > Perhaps plot_bounds.xleft = xoffset * t->xmax; should be grouped with > the above code. E.g., > > if (lmargin.x < 0) > plot_bounds.xleft = xoffset * t->xmax; > elseif (lmargin.scalex == screen) > plot_bounds.xleft = lmargin.x * (float)t->xmax; > else > plot_bounds.xleft = xoffset * t->xmax > + t->h_char * (lmargin.x >= 0 ? lmargin.x : 1); > > Dan > |