printbutton : button for printing a matplotlib plot figure ========================================================== .. automodule:: tesfdmtools.utils.widgets.printbutton :members: Example of use -------------- Below is an example of use from a piece of python code using pyplot:: import numpy import matplotlib matplotlib.use('GTK3Agg') import matplotlib.pyplot as plt # import plt from tesfdmtools.utils.widgets.printbutton import printbutton # import printbutton fig = plt.figure() # initialize matpplotlib figure ax1 = fig.add_subplot(111) # define axis printbutton(fig) # insert printbutton in toolbar x=numpy.arange(100)/100.0*numpy.pi*2.0 # define function y=numpy.sin(x) ax1.plot(x,y) # plot function ax1.set_title('test printbutton') ax1.set_xlabel('X') ax1.set_ylabel('Y') fig.caption=['This shows the use of the printbutton',\ 'printbutton is inserted in the toolbar'] # some text which goes with the plot plt.show() # show plot, with printbutton in toolbar plt.close('all') The pyplot window will show as follows, with the printbutton inserted in the toolbar .. image:: printbutton_pyplot.png :width: 400pt The preview of the plot, which is sent to the printer is shown below .. image:: printbutton_preview.png :width: 400 pt