wx.lib.plot.polyobjects.PolyHistogram¶
Creates a PolyHistogram object.
- param hist:
The histogram data.
- type hist:
sequence of
y
values that define the heights of the bars- param binspec:
The bin specification.
- type binspec:
sequence of
x
values 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
y
values that define the heights of the bars) – The histogram data.binspec (sequence of
x
values that define the edges of the bins) – The bin specification.**attr – keyword attributes
Keyword and Default
Description
Type
edgecolour='black'
edge color
edgewidth=3
edge width
float
edgestyle=wx.PENSTYLE_SOLID
edge style
wx.PenStyle
fillcolour='blue'
fill color
fillstyle=wx.BRUSHSTYLE_SOLID
fill style
wx.BrushStyle
legend=''
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