Possible bug in padding between text and bounding box for PDF

Hello,

I have been fighting with this problem for some time. It seems that

if, on a plot, I have some text inside a bounding box, it displays
fine on the screen, saves OK as a PNG, but when I save the plot as a
PDF the padding on the right side between the text and the box
disappears. I have attached a minimal example with a text box, but
this problem occurs for legends as well, if the legend text is
long-ish. I am also attaching a PNG and a PDF output, as well as how
the PDF shows up on my viewer. Has anyone else experienced this?

Other relevant info:

**$ uname -a**
Linux Merlin 3.2.0-77-generic #114-Ubuntu SMP Tue Mar 10 17:26:03

UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

**$ python -c 'import matplotlib; print matplotlib.__version__'**
1.3.1

**Where I obtained matplotlib:**
The matplotlib SourceForge site

**Customisations to** **matplotlibrc:**
backend      : Qt4Agg
lines.markersize  : 10            # markersize, in points
font.sans-serif      : Ubuntu, Calibri, Liberation Sans
font.monospace       : Consolas, Inconsolata, Ubuntu Mono, Droid

Sans Mono
axes.color_cycle : e41a1c, 377eb8, 4daf4a, 984ea3, ff7f00, ffff33,
a65628, f781bf, 999999
pdf.fonttype : 42 # Output Type 3 (Type3) or Type 42
(TrueType) # I have tried with fonttype=3 as well, and the bug still
exists

**$ python bug_test.py --verbose-helpful > output.txt**

output.txt attached

Thanks,

Sourish

bug_test.pdf (173 KB)

bug_test.png

bug_test_pdf_screenshot.png

textbox_padding_pdf.py (463 Bytes)

output.txt (811 Bytes)

Sourish,

We no longer are updating the 1.3.x releases. Can you reproduce this problem using 1.4.3?

Tom

···

On Thu, May 7, 2015 at 11:14 AM Sourish Basu <sourish.basu@…878…287…> wrote:

Hello,

I have been fighting with this problem for some time. It seems that

if, on a plot, I have some text inside a bounding box, it displays
fine on the screen, saves OK as a PNG, but when I save the plot as a
PDF the padding on the right side between the text and the box
disappears. I have attached a minimal example with a text box, but
this problem occurs for legends as well, if the legend text is
long-ish. I am also attaching a PNG and a PDF output, as well as how
the PDF shows up on my viewer. Has anyone else experienced this?

Other relevant info:

**$ uname -a**
Linux Merlin 3.2.0-77-generic #114-Ubuntu SMP Tue Mar 10 17:26:03

UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

**$ python -c 'import matplotlib; print matplotlib.__version__'**
1.3.1

**Where I obtained matplotlib:**
The matplotlib SourceForge site

**Customisations to** **matplotlibrc:**
backend      : Qt4Agg
lines.markersize  : 10            # markersize, in points
font.sans-serif      : Ubuntu, Calibri, Liberation Sans
font.monospace       : Consolas, Inconsolata, Ubuntu Mono, Droid

Sans Mono
axes.color_cycle : e41a1c, 377eb8, 4daf4a, 984ea3, ff7f00, ffff33,
a65628, f781bf, 999999
pdf.fonttype : 42 # Output Type 3 (Type3) or Type 42
(TrueType) # I have tried with fonttype=3 as well, and the bug still
exists

**$ python bug_test.py --verbose-helpful > output.txt**

output.txt attached



Thanks,

Sourish

One dashboard for servers and applications across Physical-Virtual-Cloud

Widest out-of-the-box monitoring support with 50+ applications

Performance metrics, stats and reports that give you Actionable Insights

Deep dive visibility with transaction tracing using APM Insight.

http://ad.doubleclick.net/ddm/clk/290420510;117567292;y_______________________________________________

Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

bug_test.pdf (173 KB)

output.txt (1.41 KB)

textbox_padding_pdf.py (463 Bytes)

···

Tom,

  I just updated to 1.4.3, and yes, the bug is still there. I am

attaching the PDF and PNG outputs, the python script, as well as
the output from 'python textbox_padding_pdf.py --verbose-helpful

output.txt’.

  -Sourish

  On 05/07/2015 11:19 AM, Thomas Caswell wrote:

Sourish,

    We no longer are updating the 1.3.x releases.  Can you reproduce

this problem using 1.4.3?

Tom

    On Thu, May 7, 2015 at 11:14 AM Sourish

Basu <sourish.basu@…287… >
wrote:

Hello,

        I have been fighting with this problem for some time. It

seems that if, on a plot, I have some text inside a bounding
box, it displays fine on the screen, saves OK as a PNG, but
when I save the plot as a PDF the padding on the right side
between the text and the box disappears. I have attached a
minimal example with a text box, but this problem occurs for
legends as well, if the legend text is long-ish. I am also
attaching a PNG and a PDF output, as well as how the PDF
shows up on my viewer. Has anyone else experienced this?

        Other relevant info:

        **$ uname -a**
        Linux Merlin 3.2.0-77-generic #114-Ubuntu SMP Tue Mar 10

17:26:03 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

        **              $ python -c 'import matplotlib; print

matplotlib.version’**
1.3.1

        **Where I obtained matplotlib:**
        The matplotlib SourceForge site

        **Customisations to** **matplotlibrc:**
        backend      : Qt4Agg
        lines.markersize  : 10            # markersize, in points
        font.sans-serif      : Ubuntu, Calibri, Liberation Sans
        font.monospace       : Consolas, Inconsolata, Ubuntu Mono,

Droid Sans Mono
axes.color_cycle : e41a1c, 377eb8, 4daf4a, 984ea3, ff7f00,
ffff33, a65628, f781bf, 999999
pdf.fonttype : 42 # Output Type 3 (Type3) or
Type 42 (TrueType) # I have tried with fonttype=3 as well,
and the bug still exists

        **$ python bug_test.py --verbose-helpful > output.txt**

        output.txt attached



        Thanks,

        Sourish

      One dashboard for servers and applications across

Physical-Virtual-Cloud

      Widest out-of-the-box monitoring support with 50+ applications

      Performance metrics, stats and reports that give you

Actionable Insights

      Deep dive visibility with transaction tracing using APM

Insight.

      [http://ad.doubleclick.net/ddm/clk/290420510;117567292;y](http://ad.doubleclick.net/ddm/clk/290420510;117567292;y)_______________________________________________

      Matplotlib-users mailing list

      Matplotlib-users@lists.sourceforge.net

      [https://lists.sourceforge.net/lists/listinfo/matplotlib-users](https://lists.sourceforge.net/lists/listinfo/matplotlib-users)


Q: What if you strapped C4 to a boomerang? Could this be an
effective weapon, or would it be as stupid as it sounds?
A: Aerodynamics aside, I’m curious what tactical advantage
you’re expecting to gain by having the high explosive fly back at
you if it misses the target.