matplotlib pdf generation fails with tex text

Bug #114707 reported by Steve Frécinaux on 2007-05-14
Affects Status Importance Assigned to Milestone
Fix Released
matplotlib (Ubuntu)

Bug Description

Binary package hint: python-matplotlib

When trying to save a pdf file, here is what I get:

Traceback (most recent call last):
  File "./mkgraph", line 272, in <module>
  File "/usr/lib/python2.5/site-packages/matplotlib/", line 813, in savefig
    return fig.savefig(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/matplotlib/", line 682, in savefig
    self.canvas.print_figure(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/matplotlib/backends/", line 187, in print_figure
  File "/usr/lib/python2.5/site-packages/matplotlib/backends/", line 493, in print_figure
    orientation, **kwargs)
  File "/usr/lib/python2.5/site-packages/matplotlib/backends/", line 1320, in print_figure
  File "/usr/lib/python2.5/site-packages/matplotlib/", line 544, in draw
    for a in self.axes: a.draw(renderer)
  File "/usr/lib/python2.5/site-packages/matplotlib/", line 1063, in draw
  File "/usr/lib/python2.5/site-packages/matplotlib/", line 561, in draw
  File "/usr/lib/python2.5/site-packages/matplotlib/", line 161, in draw
    if self.label1On: self.label1.draw(renderer)
  File "/usr/lib/python2.5/site-packages/matplotlib/", line 838, in draw
    Text.draw(self, renderer)
  File "/usr/lib/python2.5/site-packages/matplotlib/", line 343, in draw
    canvasw, canvash = renderer.get_canvas_width_height()
  File "/usr/lib/python2.5/site-packages/matplotlib/backends/", line 1085, in get_canvas_width_height
    return d*self.file.width, d*self.file.height
AttributeError: PdfFile instance has no attribute 'width'

Related branches

Martin Sander (forke) wrote :

pdf seems to be not officially supported, see:

I'd recommend using eps and converting with ps2pdf.

Morten Kjeldgaard (mok0) on 2008-05-30
Changed in matplotlib:
milestone: none → intrepid-alpha-1
milestone: intrepid-alpha-1 → none
milestone: none → intrepid-alpha-1
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package matplotlib - 0.91.2-2ubuntu1

matplotlib (0.91.2-2ubuntu1) intrepid; urgency=low

  * Merge from Debian unstable (LP: #233959). Remaining Ubuntu changes:
  * debian/control:
    - Change Maintainer/XSBC-Original-Maintainer field,
    - Update Build-depends: python-wxgtk2.6 -> 2.8
    - Change order of dependencies so python-gtk2 is first (LP: #223067).
  * debian/docs: adding various doc files to binary package
  * Revert to TkAgg backend instead of GTKAgg which has been the default
    in the several last Ubuntu releases. TkAgg is also the default backend
    in the Debian version. Bug (LP: #220137) seems to indicate that GTKagg
    does not work as expected, either by design or from a bug.
  * debian/rules:
    - copy debian/setup.cfg to $(CURDIR), to make TkAgg the default.
    - call dh_link for the indep target.
  * Also install /usr/share/matplotlib/matplotlib.conf, and create
    a link from /etc/matplotlibrc to /usr/share/matplotlib partly solving
    the problem described in Launchpad bug 126318.
  * debian/README.debian: add note on use of environmental variable.
  * Closing other bugs fixed by this version:
    - PDF generation is working in this version (LP: #114707)
    - personal settings file in ~/.matplotlib/matplotlibrc (LP: #124621)
    - quiver interface refactored from upstream (LP: #134919)

matplotlib (0.91.2-2) unstable; urgency=medium

  * debian/patches/bts-478237_ftbfs_gcc43.patch
    - added (Closes: #478237)
  * debian/rules
    - removed some files changes during build
  * debian/control
    - removed Depends on python-numeric-ext, python-numarray-ext (Closes:

matplotlib (0.91.2-1) unstable; urgency=low

  [ Piotr Ożarowski ]
  * Replace libwxgtk2.4-python with python-wxgtk2.6 in Depends
    (closes: #466470)

  [ Sandro Tosi ]
  * New upstream release (Closes: #459200, #474001, #447741, #408955)
  * debian/patches/build_fix.patch
    - edited to match new code
  * debian/rules
    - adjusted doc files installation
  * debian/docs
    - removed since the same files were already in debian/rules
  * debian/patches/matplotlibrc_fix.patch
    - edited to match new code (sync from Ubuntu)
  * debian/control
    - added "dvipng, python-configobj, python-enthought-traits (>= 2.0),
      python-qt-dev, python-qt4-dev, python-wxgtk2.6" as build-dep (sync from
    - bump depends on python-numpy (sync from Ubuntu)
    - added "python-qt4, dvipng, python-configobj, python-enthought-traits (>=
      2.0)" to Depends (sync from Ubuntu)
    - merged Recommends into Depends
    - removed Depends on python-pypaint since that package is unavailable
    - added myself to Uploaders
  * debian/patches/bts-468977_memory_api_usage.patch
    - fixes Python API memory usage (Closes: #468977)

 -- Morten Kjeldgaard <email address hidden> Fri, 30 May 2008 14:17:03 +0200

Changed in matplotlib:
status: New → Fix Released
Benjamin Drung (bdrung) on 2008-11-08
Changed in matplotlib:
status: New → Fix Released
Rolf Leggewie (r0lf) wrote :

Hardy has seen the end of its life and is no longer receiving any updates. Marking the Hardy task for this ticket as "Won't Fix".

Changed in matplotlib (Ubuntu Hardy):
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers