#290 ylabel text not clipped to plot boundary

closed-fixed
nobody
Drivers (161)
5
2005-09-16
2005-08-26
No

Hello,

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).

Discussion

  • Script+data test files and generated output

     
    Attachments
  • Ethan Merritt
    Ethan Merritt
    2005-09-12

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

    Logged In: YES
    user_id=235620

    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
    2005-09-16

    Logged In: YES
    user_id=235620

    Fixed for all terminals by moving text clipping into
    write_multiline().

     
  • Ethan Merritt
    Ethan Merritt
    2005-09-16

    • status: open --> closed-fixed