pyworkflow.gui.plotter module

This module implement the classes to create plots on xmipp.

class pyworkflow.gui.plotter.Plotter(x=1, y=1, mainTitle='', figsize=None, dpi=100, windowTitle='', fontsize=8, **kwargs)[source]

Bases: View

Create different types of plots using the matplotlib library.

This Plotter class has some utilities to create a Matplotlib figure and add some plots to it. Params:

x, y: number of rows and columns of the grid for plots. mainTitle: figure main title. figsize: the size of the figure, if None, it will be guessed from x and y dpi: resolution, 100 by default. windowTitle: title for the whole windows.

activate()[source]

Activate this figure.

backend = None
clear()[source]
close()[source]

Close current Plotter figure.

createCanvas()[source]
createSubPlot(title, xlabel, ylabel, xpos=None, ypos=None, yformat=False, projection='rectilinear', subtitle=None)[source]

Create a subplot in the figure. You should provide plot title, and x and y axis labels. yformat True specified the use of global self.plot_yformat Possible values for projection are:

‘aitoff’, ‘hammer’, ‘lambert’, ‘mollweide’, ‘polar’, ‘rectilinear’

draw()[source]
getCanvas()[source]
getColorBar(plot)[source]
getFigure()[source]
getLastSubPlot()[source]
isClosed()[source]

Return true if the figure have been closed.

legend(loc='best', **kwargs)[source]
savefig(*args, **kwargs)[source]
classmethod setBackend(value)[source]

Possible values are: - TkAgg for Tkinter - Agg for non-interactive plots.

show(interactive=True, block=False)[source]

This method should be overwritten to implement how this particular view will be displayed in desktop.

showLegend(labels, loc='best')[source]
tightLayout()[source]
pyworkflow.gui.plotter.getHexColorList(numberOfColors, colorName='jet')[source]

Returns a list of hexColor