Creates a PlotCanvas object.
Subclass of a wx.Panel which holds two scrollbars and the actual plotting canvas (self.canvas). It allows for simple general plotting of data with zoom, labels, and automatic axis scaling.
This is the main window that you will want to import into your application.
Parameters for __init__
are the same as any wx.Panel
.
Initialize self. See help(type(self)) for accurate signature. |
|
Erase the window. |
|
Wrapper around _Draw, which handles log axes |
|
Returns list with |
|
Returns list with |
|
Get the enableAntiAliasing value. |
|
Get the enableCenterLines value. |
|
Get the enableDiagonals value. |
|
Get the enableDrag value. |
|
Get the enableGrid value. |
|
Get the enableHiRes value. |
|
Get the enableLegend value. |
|
Set the enablePointLabel value. |
|
Get the enableTitle value. |
|
Get the enableZoom value. |
|
Get current tick and axis label font size in points |
|
Get legend font size (default is 7 point) |
|
Get Title font size (default is 15 point) |
|
Set the log scale boolean value. |
|
Get the enablePointLabel value. |
|
Get the showScrollbars value. |
|
Get the useScientificNotation value. |
|
Get the xCurrentRange value. |
|
Get the xMaxRange value. |
|
Get the xSpec value. |
|
Wrapper around _getXY, which handles log scales |
|
Get the yCurrentRange value. |
|
Get the yMaxRange value. |
|
Get the ySpec value. |
|
Used to erase pointLabel when mouse outside window |
|
Brings up the page setup dialog |
|
Converts Screen position to User Coordinates |
|
Converts User position to Screen Coordinates |
|
Print current plot. |
|
Print-preview current plot. |
|
Redraw the existing plot. |
|
Unzoom the plot. |
|
Saves the file to the type specified in the extension. If no file |
|
Move view right number of axis units. |
|
Move view up number of axis units. |
|
SetCursor(cursor) -> bool |
|
Set the enableAntiAliasing value. |
|
Set the enableCenterLines value. |
|
Set the enableDiagonals value. |
|
Set the enableDrag value. |
|
Set the enableGrid value. |
|
Set the enableHiRes value. |
|
Set the enableLegend value. |
|
Set the enablePointLabel value. |
|
Set the enableTitle value. |
|
Set the enableZoom value. |
|
Set the tick and axis label font size (default is 10 point) |
|
Set legend font size (default is 7 point) |
|
Set Title font size (default is 15 point) |
|
Set the log scale boolean value. |
|
Set the enablePointLabel value. |
|
Set the showScrollbars value. |
|
Set the useScientificNotation value. |
|
Set the xSpec value. |
|
Set the ySpec value. |
|
Updates the pointLabel point on screen with data contained in |
|
Zoom on the plot |
The absScale value as a 2-tuple of bools |
|
The |
|
The |
|
The |
|
The current enableAntiAliasing value. |
|
The current enableAxes value. |
|
The current enableAxesLabels value. |
|
The current enableAxesValues value. |
|
The current enableCenterLines value. |
|
The current enableDiagonals value. |
|
The current enableDrag value. |
|
The current enableGrid value. |
|
The current enableHiRes value. |
|
The current enableLegend value. |
|
The current enablePlotTitle value. |
|
The current enablePointLabel value. |
|
The current enableTicks value. |
|
The current enableTitle value. |
|
The current enableXAxisLabel value. |
|
The current enableYAxisLabel value. |
|
The current enableZoom value. |
|
The current tick and axis label font size in points. |
|
The current Legned font size in points. |
|
The current Title font size in points. |
|
The |
|
The logScale value as a 2-tuple of bools |
|
The current pointLabelFunc value. |
|
The current showScrollbars value. |
|
The length of the tick marks on an axis. |
|
The |
|
The current useScientificNotation value. |
|
The plots’ X range of the currently displayed portion as |
|
The plots’ maximum X range as a tuple of |
|
Defines the X axis type. |
|
The plots’ Y range of the currently displayed portion as |
|
The plots’ maximum Y range as a tuple of |
|
Defines the Y axis type. |
PlotCanvas
(wx.Panel)¶Creates a PlotCanvas object.
Subclass of a wx.Panel which holds two scrollbars and the actual plotting canvas (self.canvas). It allows for simple general plotting of data with zoom, labels, and automatic axis scaling.
This is the main window that you will want to import into your application.
Parameters for __init__
are the same as any wx.Panel
.
__init__
(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, name="plotCanvas")¶Initialize self. See help(type(self)) for accurate signature.
Clear
(self)¶Erase the window.
Draw
(self, graphics, xAxis=None, yAxis=None, dc=None)¶Wrapper around _Draw, which handles log axes
GetClosestPoint
(self, pntXY, pointScaled=True)¶Returns list with [curveNumber, legend, index of closest point, pointXY, scaledXY, distance] list for only the closest curve. Returns [] if no curves are being plotted.
x, y in user coords
if pointScaled == True
based on screen coords
if pointScaled == False
based on user coords
GetClosestPoints
(self, pntXY, pointScaled=True)¶Returns list with [curveNumber, legend, index of closest point, pointXY, scaledXY, distance] list for each curve. Returns [] if no curves are being plotted.
x, y in user coords
if pointScaled == True
based on screen coords
if pointScaled == False
based on user coords
GetEnableAntiAliasing
(self)¶Get the enableAntiAliasing value.
Deprecated since version Feb: 27, 2016
Use the
enableAntiAliasing
property instead.
GetEnableCenterLines
(self)¶Get the enableCenterLines value.
Deprecated since version Feb: 27, 2016
Use the enableCenterLines
property instead.
GetEnableDiagonals
(self)¶Get the enableDiagonals value.
Deprecated since version Feb: 27, 2016
Use the enableDiagonals
property instead.
GetEnableDrag
(self)¶Get the enableDrag value.
Deprecated since version Feb: 27, 2016
Use the enableDrag
property instead.
GetEnableGrid
(self)¶Get the enableGrid value.
Deprecated since version Feb: 27, 2016
Use the enableGrid
property instead.
GetEnableHiRes
(self)¶Get the enableHiRes value.
Deprecated since version Feb: 27, 2016
Use the enableHiRes
property instead.
GetEnableLegend
(self)¶Get the enableLegend value.
Deprecated since version Feb: 27, 2016
Use the enableLegend
property instead.
GetEnablePointLabel
(self)¶Set the enablePointLabel value.
Deprecated since version Feb: 27, 2016
Use the enablePointLabel
property instead.
GetEnableTitle
(self)¶Get the enableTitle value.
Deprecated since version Feb: 27, 2016
Use the enableTitle
property instead.
GetEnableZoom
(self)¶Get the enableZoom value.
Deprecated since version Feb: 27, 2016
Use the enableZoom
property instead.
GetFontSizeAxis
(self)¶Get current tick and axis label font size in points
Deprecated since version Feb: 27, 2016
Use the fontSizeAxis
property
instead.
GetFontSizeLegend
(self)¶Get legend font size (default is 7 point)
Deprecated since version Feb: 27, 2016
Use the :attr:`~wx.lib.plot.plotcanvas.PlotCanvas.fontSizeLegend’ property instead.
GetFontSizeTitle
(self)¶Get Title font size (default is 15 point)
Deprecated since version Feb: 27, 2016
Use the fontSizeTitle
property instead.
getLogScale
(self)¶Set the log scale boolean value.
Deprecated since version Feb: 27, 2016
Use the logScale
property instead.
GetPointLabelFunc
(self)¶Get the enablePointLabel value.
Deprecated since version Feb: 27, 2016
Use the enablePointLabel
property instead.
GetShowScrollbars
(self)¶Get the showScrollbars value.
Deprecated since version Feb: 27, 2016
Use the showScrollbars
property instead.
GetUseScientificNotation
(self)¶Get the useScientificNotation value.
Deprecated since version Feb: 27, 2016
Use the
useScientificNotation
property instead.
GetXCurrentRange
(self)¶Get the xCurrentRange value.
Deprecated since version Feb: 27, 2016
Use the xCurrentRange
property instead.
GetXMaxRange
(self)¶Get the xMaxRange value.
Deprecated since version Feb: 27, 2016
Use the xMaxRange
property instead.
GetXSpec
(self)¶Get the xSpec value.
Deprecated since version Feb: 27, 2016
Use the xSpec
property instead.
GetXY
(self, event)¶Wrapper around _getXY, which handles log scales
GetYCurrentRange
(self)¶Get the yCurrentRange value.
Deprecated since version Feb: 27, 2016
Use the yCurrentRange
property instead.
GetYMaxRange
(self)¶Get the yMaxRange value.
Deprecated since version Feb: 27, 2016
Use the yMaxRange
property instead.
GetYSpec
(self)¶Get the ySpec value.
Deprecated since version Feb: 27, 2016
Use the ySpec
property instead.
OnLeave
(self, event)¶Used to erase pointLabel when mouse outside window
OnMotion
(self, event)¶OnMouseDoubleClick
(self, event)¶OnMouseLeftDown
(self, event)¶OnMouseLeftUp
(self, event)¶OnMouseRightDown
(self, event)¶OnPaint
(self, event)¶OnScroll
(self, evt)¶OnSize
(self, event)¶PageSetup
(self)¶Brings up the page setup dialog
PositionScreenToUser
(self, pntXY)¶Converts Screen position to User Coordinates
PositionUserToScreen
(self, pntXY)¶Converts User position to Screen Coordinates
Printout
(self, paper=None)¶Print current plot.
PrintPreview
(self)¶Print-preview current plot.
Redraw
(self, dc=None)¶Redraw the existing plot.
Reset
(self)¶Unzoom the plot.
SaveFile
(self, fileName='')¶Saves the file to the type specified in the extension. If no file
name is specified a dialog box is provided. Returns True
if
successful, otherwise False.
.bmp Save a Windows bitmap file. .xbm Save an X bitmap file. .xpm Save an XPM bitmap file. .png Save a Portable Network Graphics file. .jpg Save a Joint Photographic Experts Group file.
ScrollRight
(self, units)¶Move view right number of axis units.
ScrollUp
(self, units)¶Move view up number of axis units.
SetCursor
(self, cursor)¶SetCursor(cursor) -> bool
Sets the window’s cursor.
SetEnableAntiAliasing
(self, enableAntiAliasing)¶Set the enableAntiAliasing value.
Deprecated since version Feb: 27, 2016
Use the
enableAntiAliasing
property instead.
SetEnableCenterLines
(self, value)¶Set the enableCenterLines value.
Deprecated since version Feb: 27, 2016
Use the enableCenterLines
property instead.
SetEnableDiagonals
(self, value)¶Set the enableDiagonals value.
Deprecated since version Feb: 27, 2016
Use the enableDiagonals
property instead.
SetEnableDrag
(self, value)¶Set the enableDrag value.
Deprecated since version Feb: 27, 2016
Use the enableDrag
property instead.
SetEnableGrid
(self, value)¶Set the enableGrid value.
Deprecated since version Feb: 27, 2016
Use the enableGrid
property instead.
SetEnableHiRes
(self, enableHiRes)¶Set the enableHiRes value.
Deprecated since version Feb: 27, 2016
Use the enableHiRes
property instead.
SetEnableLegend
(self, value)¶Set the enableLegend value.
Deprecated since version Feb: 27, 2016
Use the enableLegend
property instead.
SetEnablePointLabel
(self, value)¶Set the enablePointLabel value.
Deprecated since version Feb: 27, 2016
Use the enablePointLabel
property instead.
SetEnableTitle
(self, value)¶Set the enableTitle value.
Deprecated since version Feb: 27, 2016
Use the enableTitle
property instead.
SetEnableZoom
(self, value)¶Set the enableZoom value.
Deprecated since version Feb: 27, 2016
Use the enableZoom
property instead.
SetFontSizeAxis
(self, point=10)¶Set the tick and axis label font size (default is 10 point)
Deprecated since version Feb: 27, 2016
Use the fontSizeAxis
property
instead.
SetFontSizeLegend
(self, point=7)¶Set legend font size (default is 7 point)
Deprecated since version Feb: 27, 2016
Use the :attr:`~wx.lib.plot.plotcanvas.PlotCanvas.fontSizeLegend’ property instead.
SetFontSizeTitle
(self, point=15)¶Set Title font size (default is 15 point)
Deprecated since version Feb: 27, 2016
Use the fontSizeTitle
property instead.
setLogScale
(self, logscale)¶Set the log scale boolean value.
Deprecated since version Feb: 27, 2016
Use the logScale
property instead.
SetPointLabelFunc
(self, func)¶Set the enablePointLabel value.
Deprecated since version Feb: 27, 2016
Use the enablePointLabel
property instead.
SetShowScrollbars
(self, value)¶Set the showScrollbars value.
Deprecated since version Feb: 27, 2016
Use the showScrollbars
property instead.
SetUseScientificNotation
(self, useScientificNotation)¶Set the useScientificNotation value.
Deprecated since version Feb: 27, 2016
Use the
useScientificNotation
property instead.
SetXSpec
(self, spectype='auto')¶Set the xSpec value.
Deprecated since version Feb: 27, 2016
Use the xSpec
property instead.
SetYSpec
(self, spectype='auto')¶Set the ySpec value.
Deprecated since version Feb: 27, 2016
Use the ySpec
property instead.
UpdatePointLabel
(self, mDataDict)¶Updates the pointLabel point on screen with data contained in mDataDict.
mDataDict will be passed to your function set by SetPointLabelFunc. It can contain anything you want to display on the screen at the scaledXY point you specify.
This function can be called from parent window with onClick, onMotion events etc.
Zoom
(self, Center, Ratio)¶Zoom on the plot Centers on the X,Y coords given in Center Zooms by the Ratio = (Xratio, Yratio) given
absScale
¶The absScale value as a 2-tuple of bools:
(x_axis_is_abs_scale, y_axis_is_abs_scale)
.
Returns the value of absScale.
Sets the value of absScale.
tuple of bools, length 2
TypeError when setting an invalid value.
enableAntiAliasing
¶The current enableAntiAliasing value.
Returns the value of enableAntiAliasing.
Sets the value of enableAntiAliasing.
bool
TypeError if setting a non-boolean value.
enableAxes
¶The current enableAxes value.
Returns the value of enableAxes.
Sets the value of enableAxes.
bool, 2-tuple of bool, or 4-tuple of bool
TypeError if setting an invalid value.
ValueError if the tuple has incorrect length.
If bool, enable or disable all axis
If 2-tuple, enable or disable the bottom or left axes: (bottom,
left)
If 4-tuple, enable or disable each axis individually: (bottom,
left, top, right)
enableAxesLabels
¶The current enableAxesLabels value.
Returns the value of enableAxesLabels.
Sets the value of enableAxesLabels.
bool
TypeError if setting an invalid value.
enableAxesValues
¶The current enableAxesValues value.
Returns the value of enableAxesValues.
Sets the value of enableAxesValues.
bool, 2-tuple of bool, or 4-tuple of bool
TypeError if setting an invalid value.
ValueError if the tuple has incorrect length.
If bool, enable or disable all axis values
If 2-tuple, enable or disable the bottom or left axes values:
(bottom, left)
If 4-tuple, enable or disable each axis value individually:
(bottom, left, top, right)
enableCenterLines
¶The current enableCenterLines value.
Returns the value of enableCenterLines.
Sets the value of enableCenterLines.
bool or str
TypeError if setting an invalid value.
If set to a single boolean value, then both horizontal and vertical lines will be enabled or disabled.
If a string, must be one of ('Horizontal', 'Vertical')
.
enableDiagonals
¶The current enableDiagonals value.
Returns the value of enableDiagonals.
Sets the value of enableDiagonals.
bool or str
TypeError if setting an invalid value.
If set to a single boolean value, then both diagonal lines will be enabled or disabled.
If a string, must be one of ('Bottomleft-Topright',
'Bottomright-Topleft')
.
enableDrag
¶The current enableDrag value.
Returns the value of enableDrag.
Sets the value of enableDrag.
bool
TypeError if setting a non-boolean value.
enableGrid
¶The current enableGrid value.
Returns the value of enableGrid.
Sets the value of enableGrid.
bool or 2-tuple of bools
TypeError if setting an invalid value.
If set to a single boolean value, then both X and y grids will be
enabled (enableGrid = True
) or disabled (enableGrid = False
).
If a 2-tuple of bools, the 1st value is the X (vertical) grid and the 2nd value is the Y (horizontal) grid.
enableHiRes
¶The current enableHiRes value.
Returns the value of enableHiRes.
Sets the value of enableHiRes.
bool
TypeError if setting a non-boolean value.
enableLegend
¶The current enableLegend value.
Returns the value of enableLegend.
Sets the value of enableLegend.
bool
TypeError if setting a non-boolean value.
enablePlotTitle
¶The current enablePlotTitle value.
Returns the value of enablePlotTitle.
Sets the value of enablePlotTitle.
bool
TypeError if setting an invalid value.
enablePointLabel
¶The current enablePointLabel value.
Returns the value of enablePointLabel.
Sets the value of enablePointLabel.
bool
TypeError if setting a non-boolean value.
enableTicks
¶The current enableTicks value.
Returns the value of enableTicks.
Sets the value of enableTicks.
bool, 2-tuple of bool, or 4-tuple of bool
TypeError if setting an invalid value.
ValueError if the tuple has incorrect length.
If bool, enable or disable all ticks
If 2-tuple, enable or disable the bottom or left ticks:
(bottom, left)
If 4-tuple, enable or disable each tick side individually:
(bottom, left, top, right)
enableTitle
¶The current enableTitle value.
Returns the value of enableTitle.
Sets the value of enableTitle.
bool
TypeError if setting a non-boolean value.
enableXAxisLabel
¶The current enableXAxisLabel value.
Returns the value of enableXAxisLabel.
Sets the value of enableXAxisLabel.
bool
TypeError if setting an invalid value.
enableYAxisLabel
¶The current enableYAxisLabel value.
Returns the value of enableYAxisLabel.
Sets the value of enableYAxisLabel.
bool
TypeError if setting an invalid value.
enableZoom
¶The current enableZoom value.
Returns the value of enableZoom.
Sets the value of enableZoom.
bool
TypeError if setting a non-boolean value.
fontSizeAxis
¶The current tick and axis label font size in points.
Default is 10pt font.
Returns the value of fontSizeAxis.
Sets the value of fontSizeAxis.
int or float
fontSizeLegend
¶The current Legned font size in points.
Default is 7pt font.
Returns the value of fontSizeLegend.
Sets the value of fontSizeLegend.
int or float
fontSizeTitle
¶The current Title font size in points.
Default is 15pt font.
Returns the value of fontSizeTitle.
Sets the value of fontSizeTitle.
int or float
logScale
¶The logScale value as a 2-tuple of bools:
(x_axis_is_log_scale, y_axis_is_log_scale)
.
Returns the value of logScale.
Sets the value of logScale.
tuple of bools, length 2
TypeError when setting an invalid value.
pageSetupData
¶See pageSetupData
pointLabelFunc
¶The current pointLabelFunc value.
Returns the value of pointLabelFunc.
Sets the value of pointLabelFunc.
function
TODO: More information is needed. Sets the function with custom code for pointLabel drawing
print_data
¶See print_data
showScrollbars
¶The current showScrollbars value.
Returns the value of showScrollbars.
Sets the value of showScrollbars.
bool
TypeError if setting a non-boolean value.
tickLength
¶The length of the tick marks on an axis.
Returns the length of the tick marks.
Sets the length of the tick marks.
tuple of (xlength, ylength): int or float
TypeError when setting a value that is not an int or float.
tickLengthPrinterScale
¶useScientificNotation
¶The current useScientificNotation value.
Returns the value of useScientificNotation.
Sets the value of useScientificNotation.
bool
TypeError if setting a non-boolean value.
xCurrentRange
¶The plots’ X range of the currently displayed portion as
a tuple of (min, max)
Returns the value of xCurrentRange.
See also
xMaxRange
¶The plots’ maximum X range as a tuple of (min, max)
.
Returns the value of xMaxRange.
See also
xSpec
¶Defines the X axis type.
Default is ‘auto’.
Returns the value of xSpec.
Sets the value of xSpec.
str, int, or length-2 sequence of floats
TypeError if setting an invalid value.
Valid strings: + ‘none’ - shows no axis or tick mark values + ‘min’ - shows min bounding box values + ‘auto’ - rounds axis range to sensible values
Other valid values: + <number> - like ‘min’, but with <number> tick marks + list or tuple: a list of (min, max) values. Must be length 2.
See also
yCurrentRange
¶The plots’ Y range of the currently displayed portion as
a tuple of (min, max)
Returns the value of yCurrentRange.
See also
yMaxRange
¶The plots’ maximum Y range as a tuple of (min, max)
.
Returns the value of yMaxRange.
See also
ySpec
¶Defines the Y axis type.
Default is ‘auto’.
Returns the value of xSpec.
Sets the value of xSpec.
str, int, or length-2 sequence of floats
TypeError if setting an invalid value.
Valid strings: + ‘none’ - shows no axis or tick mark values + ‘min’ - shows min bounding box values + ‘auto’ - rounds axis range to sensible values
Other valid values: + <number> - like ‘min’, but with <number> tick marks + list or tuple: a list of (min, max) values. Must be length 2.
See also