Skip to content

pyplot.savefig: add support for PDF format #70

@felipeespic

Description

@felipeespic

Hi,

I cannot save a figure in pdf format programmatically. However I can do it from the GUI (sometimes, depending on the type of figure).

Example 1:
pl.plot(np.arange(23))
pl.savefig('fig.pdf')
Out:
AssertionError: Function 'savefig' currently supports the following formats:
bw,eps,epsf,epsi,pcx,rgb,rgba,sgi,tga,bmp,bw,eps,epsf,epsi,ico,jp2,jpeg,jpg,pcx,pic,png,ppm,rgb,rgba,sgi,tga,tif,tiff,webp,xbm,xpm,xv

However, the description of the function pl.savefig says: "Currently supports PDF and PNG formats only"

Example 2:
pl.plot(np.arange(23))
pl.savefig('fig.pdf', format='pdf')
Out:
self.print_(printer)
File "/usr/local/lib/python2.7/dist-packages/guiqwt-3.0.2-py2.7-linux-x86_64.egg/guiqwt/pyplot.py", line 289, in print_ax.widget.print_(paint, QRect(ox, oy, w, h))
TypeError: print_() takes exactly 2 arguments (3 given)

Thanks,
Felipe

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions