spacepy.plot.utils.printfig

spacepy.plot.utils.printfig(fignum, saveonly=False, pngonly=False, clean=False, filename=None)[source]

save current figure to file and call lpr (print).

This routine will create a total of 3 files (png, ps and c.png) in the current working directory with a sequence number attached. Also, a time stamp and the location of the file will be imprinted on the figure. The file ending with c.png is clean and no directory or time stamp are attached (good for PowerPoint presentations).

Parameters:
fignuminteger

matplotlib figure number

saveonlyboolean (optional)

True (don’t print and save only to file) False (print and save)

pngolnyboolean (optional)

True (only save png files and print png directly) False (print ps file, and generate png, ps; can be slow)

cleanboolean (optional)

True (print and save only clean files without directory info) False (print and save directory location as well)

filenamestring (optional)

None (If specified then the filename is set and code does not use the sequence number)

Examples

>>> import spacepy.plot.utils
>>> import matplotlib.pyplot as plt
>>> p = plt.plot([1,2,3],[2,3,2])
>>> spacepy.plot.utils.printfig(1, pngonly=True, saveonly=True)