Module: plotwrap

*** For now, plotwrap is hardwired for TkAgg this is not great, but also not a high priority to fix for now; PlotWinP might be the start of a decent fix

but plotwrap was built with the idea that you could have a plot without a window, and pyplot relies on the new_figure_manager functions in the backends, which always make a window; what we need is something to make the figure and the canvas without the figure manager ... but FigureCanvasMac

... how does one get a drawable figure that is not necessarily drawn?!

4 Classes

class hexrd.plotwrap.PlotWin(numRows=1, numCols=-1, title='PlotWin window', figure=None, relfigsize=(3, 3), axesList=None, noAutoAxesList=False, dpi=100)[source]
__init__(numRows=1, numCols=-1, title='PlotWin window', figure=None, relfigsize=(3, 3), axesList=None, noAutoAxesList=False, dpi=100)[source]

If pass negative numCols, then numRows is the number of plots and the layout is done automatically

getAxes(plotNum, rect=None, withPW=False, **axprops)[source]

careful: plotNum is from 0, not 1 as is the case for subplot axprops is useful for this like setting sharex and sharey

class hexrd.plotwrap.PlotWinLite(canvas, figure, axes)[source]

Lightweight PlotWin substitute for when windows are being controlled by code outside of plotwrap

__init__(canvas, figure, axes)[source]
haveXLabels()[source]

may want to turn off any functionality in this method

haveYLabels()[source]

may want to turn off any functionality in this method

class hexrd.plotwrap.PlotWinP(axes=None, as3D=False, title=None, **kwargs)[source]

Just wrap pyplot

__init__(axes=None, as3D=False, title=None, **kwargs)[source]
haveXLabels()[source]

may want to turn off any functionality in this method

haveYLabels()[source]

may want to turn off any functionality in this method

pwList = None

for now, punt on setting a title

class hexrd.plotwrap.PlotWrap(**keyArgs)[source]

Bases: object

__init__(**keyArgs)[source]
colorbar(rect=(0.8, 0.1, 0.05, 0.8), adjustPos=True, thing=None, **kwargs)[source]

if set rect to None, then colorbar steals self.a

destroy()[source]

does not clean up self.a, just kills the window if this plot owns the window

ownCanvas = None

checking self.showByDefault here causes trouble because it is hard to attach a figure to a window later for a general backend ***

save(**keyArgs)[source]

make hardcopy of the current figure; specify filename or prefix keyword argument

6 Functions

hexrd.plotwrap.autoTicks(x, n, format='%0.2e')[source]
hexrd.plotwrap.argToPW(arg)[source]
hexrd.plotwrap.hist2D(xVals, yVals, bins, hRange=None, weights=None, **kwArgs)[source]

Plot 2D histogram of data yVals versus xVals, with number of bins given by bins (int or 2-tuple)

hexrd.plotwrap.plotHist2D(xedges, yedges, H, hRange=None, logScale=False, minCount=1, win=None, xlabel=None, ylabel=None, xformat=None, yformat=None, nXTics=0, nYTics=0, winArgs={})[source]

winArgs can include things like title, relfigsize, dpi

hexrd.plotwrap.makeHist2D(xVals, yVals, bins, hRange=None, weights=None)[source]
hexrd.plotwrap.main()[source]