#290 ylabel text not clipped to plot boundary

Drivers (161)


I've been using gnuplot 4.0 under Windows and I've
noticed a consistent bug with metapost ('mp') driver.
If I use the 'set ylabel' command with a low, positive
value for lmargin, the generated .mp file has a line
with a very big numeric value:

put_text( btex RMS error etex, 429496711.3a, 378.9b,
1, 2);

Then mpost complains about this value when I try to
compile the file:

! Enormous number has been reduced.

and the label is missing in the final eps file. None
of that happens with other drivers (e.g.,
'postscript'). I have also downloaded the last CVS
sources (as of 2005-08-26) and compiled it (under
Cygwin), but still got the same error.

I wonder if this error is caused by some
signed/unsigned conflict in the source code...

I'm sending the .gp script, the data file and the
generated .mp file (error is in the line 180).


  • Script+data test files and generated output

  • Ethan Merritt
    Ethan Merritt

    • summary: lmargin fails with 'mp' driver --> ylabel text not clipped to plot boundary
  • Ethan Merritt
    Ethan Merritt

    Logged In: YES

    It turns out that this error is not specific to the mp driver.
    It is, rather, yet another example of the horrible problems
    we are having because the core routines use unsigned
    arithmetic for coordinates.

    What happens is that if you set the lmargin value to be too
    small to allow room for the y-axis label, then this x
    coordinate of the label goes negative (off the left edge of
    the plot). However, because the coordinate is stored as an
    unsigned number, this makes it look instead like a large
    positive value.

    Yes, it definitely needs to be fixed. But the proper fix
    has nothing to do with the mp driver.

  • Ethan Merritt
    Ethan Merritt

    Logged In: YES

    Fixed for all terminals by moving text clipping into

  • Ethan Merritt
    Ethan Merritt

    • status: open --> closed-fixed