#1088 enhanced text in legend messes up formatting in multiplots

closed-works-for-me
nobody
2D plot (258)
5
2012-04-20
2012-01-25
Craig DeForest
No

I've been making a bunch of multiplots and have found a number of cases where multiplot formatting is not the same between adjacent panels, even if the exact same plot commands are sent. I am not sure of *all* the cases that trigger this, but at least placing enhanced text in the legend seems to do so. Here are some test commands that make two (slightly) different panels that should be identical. I include a PDF showing the output of the commands, and also a PDF showing the more extreme cases I'm dealing with in real life.

G N U P L O T
Version 4.4 patchlevel 3
last modified March 2011
System: Darwin 10.8.0

Copyright (C) 1986-1993, 1998, 2004, 2007-2010
Thomas Williams, Colin Kelley and many others

gnuplot home: http://www.gnuplot.info
faq, bugs, etc: type "help seeking-assistance"
immediate help: type "help"
plot window: hit 'h'

Terminal type set to 'aqua'
gnuplot> set terminal pdf enhanced font "Helvetica,9" size 6,3
Terminal type set to 'pdf'
Options are ' enhanced fname 'Helvetica' fsize 9 linewidth 1.0 size 6.00in, 3.00in '
gnuplot> set output "foo.pdf"
gnuplot> set multiplot layout 1,2
multiplot> plot '-' using 1:2 title "{Symbol FOO}^{23}" with lines, '-' using 1:2 title "{/Symbol BAR}" with liinput data ('e' ends) > 0 1
input data ('e' ends) > 1 2
input data ('e' ends) > e
input data ('e' ends) > 0.5 1
input data ('e' ends) > 1.5 0.75
input data ('e' ends) > e
multiplot> plot '-' using 1:2 title "{Symbol FOO}^{23}" with lines, '-' using 1:2 title "{/Symbol BAR}" with lines
input data ('e' ends) > 0 1
input data ('e' ends) > 1 2
input data ('e' ends) > e
input data ('e' ends) > 0.5 1
input data ('e' ends) > 1.5 0.75
input data ('e' ends) > e
multiplot> unset multiplot
gnuplot> ^D

Discussion

  • Craig DeForest
    Craig DeForest
    2012-01-25

    Output from the above commands. The panels should be identical but are not.

     
    Attachments
  • Craig DeForest
    Craig DeForest
    2012-01-25

    Update: It appears that the bug is triggered iff the last character in the legend is superscripted. If I insert a non-superscripted " " after (e.g.) the degree sign in the more complex example figure, the problem vanishes. (I used "^{o}" to render the degree sign).

     
  • Craig DeForest
    Craig DeForest
    2012-01-25

    A more complex plot showing the bug to greater extreme. Note both compressed legend text and different plot size in the two windows.

     
    Attachments
  • Ethan Merritt
    Ethan Merritt
    2012-01-25

    I can't reproduce this problem using either the PDFLib pdf terminal or the pdfcairo terminal. However, my PDFLib must be newer than yours since it creates a file at PDF level 1.5 whereas your attachments are at PDF level 1.4.

    I suspect a font-handling problem that leaves the default font at the start of the second plot different from the default font at the start of the first plot. Beyond that, I don't know where to point a finger since I can't reproduce the problem.

     
  • Ethan Merritt
    Ethan Merritt
    2012-04-20

    • status: open --> closed-works-for-me