pwem.viewers.plotter module

class pwem.viewers.plotter.EmPlotter(x=1, y=1, mainTitle='', **kwargs)[source]

Bases: Plotter

Class to create several plots.

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.

classmethod createFromFile(dbName, dbPreffix, plotType, columnsStr, colorsStr, linesStr, markersStr, xcolumn, ylabel, xlabel, title, bins, orderColumn, orderDirection)[source]
plotAngularDistribution(title, rot, tilt, weight=[], max_p=40, min_p=5, color='blue')[source]

Create an special type of subplot, representing the angular distribution of weight projections.

plotAngularDistributionFromMd(mdFile, title, **kwargs)[source]

Read the values of rot, tilt and weights from the metadata and plot the angular distribution. ANGLES are in DEGREES In the metadata:

rot: MDL_ANGLE_ROT tilt: MDL_ANGLE_TILT weight: MDL_WEIGHT

plotAngularDistributionHistogram(title, rot, tilt)[source]

Create an special type of subplot, representing the angular distribution of weight projections.

plotData(xValues, yValues, color='blue', **kwargs)[source]

Shortcut function to plot some values. Params:

xValues: list of values to show in x-axis yValues: list of values to show as values in y-axis color: color for the plot. **kwargs: keyword arguments that accepts:

marker, linestyle

plotDataBar(xValues, yValues, width, color='blue', **kwargs)[source]

Shortcut function to plot some values. Params:

xValues: list of values to show in x-axis yValues: list of values to show as values in y-axis color: color for the plot. **kwargs: keyword arguments that accepts:

marker, linestyle

plotHist(yValues, nbins, color='blue', **kwargs)[source]

Create an histogram.

plotMatrix(img, matrix, vminData, vmaxData, cmap='jet', xticksLablesMajor=None, yticksLablesMajor=None, rotationX=90.0, rotationY=0.0, **kwargs)[source]
plotScatter(xValues, yValues, color='blue', **kwargs)[source]

Create an scatter plot.

class pwem.viewers.plotter.PlotData(fileName, tableName, orderColumn, orderDirection)[source]

Bases: object

Small wrapper around table data such as: sqlite or metadata files.