chartpanel
A canvas for displaying a chart within a wxPython window
Classes:
|
Panel that contains a matplotlib plotting window, used for displaying an image. |
-
class
ChartPanelBase
(parent, fig, ax, id=- 1, pos=(- 1, - 1), size=(- 1, - 1), style=0, name=b'panel')[source] Bases:
Panel
Panel that contains a matplotlib plotting window, used for displaying an image. The image can be right clicked to bring up a context menu allowing copying, pasting and saving of the image. The image can be panned by holding the left mouse button and moving the mouse, and zoomed in and out using the scrollwheel on the mouse.
- Parameters
parent (
Window
) – The parent window.fig (
Figure
)ax (
Axes
)id (
int
) – An identifier for the panel. wx.ID_ANY is taken to mean a default. Default-1
.pos (
Point
) – The panel position. The valuewx.DefaultPosition
indicates a default position, chosen by either the windowing system or wxWidgets, depending on platform. Default(-1, -1)
.size (
Size
) – The panel size. The value ::wxDefaultSize indicates a default size, chosen by either the windowing system or wxWidgets, depending on platform. Default(-1, -1)
.style (
int
) – The window style. See wxPanel. Default0
.name (
str
) – Window name. Defaultb'panel'
.
Methods:
configure_borders
([event])Open the
Configure Borders
dialog.constrain_zoom
([key])Constrain zoom to the x axis only.
Event handler for size change events
pan
([enable])Enable the Pan tool.
previous_view
(*_)Go to the previous view of the chart.
reset_view
(*_)Reset the view of the chart.
setup_scrollwheel_zooming
([scale])Allow zooming of the chart with the scrollwheel.
setup_ylim_refresher
(y_data, x_data)Setup the function for updating the ylim whenever the xlim changes.
Internal function that runs whenever the window is resized.
zoom
([enable])Enable the Zoom tool.
-
constrain_zoom
(key='x')[source] Constrain zoom to the x axis only.
- Parameters
key (
str
) – Default'x'
.
-
setup_scrollwheel_zooming
(scale=1.1)[source] Allow zooming of the chart with the scrollwheel.
- Parameters
scale (
float
) – Default1.1
.