wx.lib.plot.polyobjects.PolyHistogram¶
Creates a PolyHistogram object.
- param hist:
The histogram data.
- type hist:
sequence of
yvalues that define the heights of the bars- param binspec:
The bin specification.
- type binspec:
sequence of
xvalues that define the edges of the bins- param **attr:
keyword attributes
Keyword and Default |
Description |
Type |
|---|---|---|
|
edge color |
|
|
edge width |
float |
|
edge style |
|
|
fill color |
|
|
fill style |
|
|
legend string |
str |
Tip
Use np.histogram() to easily create your histogram parameters:
hist_data, binspec = np.histogram(data)
hist_plot = PolyHistogram(hist_data, binspec)
Important
len(binspec) must equal len(hist) + 1.
Warning
All methods except __init__ are private.
Class Hierarchy¶
Known Superclasses¶
wx.lib.plot.polyobjects.PolyBarsBase
Methods Summary¶
Calculate the rectangle for plotting. |
|
Draw the bars |
Class API¶
- class PolyHistogram(PolyBarsBase)¶
Creates a PolyHistogram object.
- Parameters:
hist (sequence of
yvalues that define the heights of the bars) – The histogram data.binspec (sequence of
xvalues that define the edges of the bins) – The bin specification.**attr – keyword attributes
Keyword and Default
Description
Type
edgecolour='black'edge color
edgewidth=3edge width
float
edgestyle=wx.PENSTYLE_SOLIDedge style
wx.PenStylefillcolour='blue'fill color
fillstyle=wx.BRUSHSTYLE_SOLIDfill style
wx.BrushStylelegend=''legend string
str
Tip
Use
np.histogram()to easily create your histogram parameters:hist_data, binspec = np.histogram(data) hist_plot = PolyHistogram(hist_data, binspec)
Important
len(binspec)must equallen(hist) + 1.Warning
All methods except
__init__are private.
Methods¶
- __init__(self, hist, binspec, \*\*attr)¶
- calc_rect(self, y, low, high)¶
Calculate the rectangle for plotting.
- draw(self, dc, printerScale, coord=None)¶
Draw the bars