Subclass of a wxWindow to allow simple general plotting
of data with zoom, labels, and automatic axis scaling.
Methods
|
|
|
|
Clear
|
Clear ( self )
Erase the window.
|
|
Draw
|
Draw (
self,
graphics,
xAxis=None,
yAxis=None,
dc=None,
)
Draw objects in graphics with specified x and y axis.
graphics- instance of PlotGraphics with list of PolyXXX objects
xAxis - tuple with (min, max) axis range to view
yAxis - same as xAxis
dc - drawing context - doesn't have to be specified.
If it's not, the offscreen buffer is used
Exceptions
|
|
TypeError, "xAxis should be None or (minX,maxX)"
TypeError, "yAxis should be None or (minY,maxY)"
|
|
|
GetEnableGrid
|
GetEnableGrid ( self )
True if grid enabled.
|
|
GetEnableLegend
|
GetEnableLegend ( self )
True if Legend enabled.
|
|
GetEnableZoom
|
GetEnableZoom ( self )
True if zooming enabled.
|
|
GetFontSizeAxis
|
GetFontSizeAxis ( self )
Get current tick and axis label font size in points
|
|
GetFontSizeLegend
|
GetFontSizeLegend ( self )
Get current Legend font size in points
|
|
GetFontSizeTitle
|
GetFontSizeTitle ( self )
Get current Title font size in points
|
|
GetXCurrentRange
|
GetXCurrentRange ( self )
Returns (minX, maxX) x-axis for currently displayed portion of graph
|
|
GetXMaxRange
|
GetXMaxRange ( self )
Returns (minX, maxX) x-axis range for displayed graph
|
|
GetXSpec
|
GetXSpec ( self )
Returns current XSpec for axis
|
|
GetXY
|
GetXY ( self, event )
Takes a mouse event and returns the XY user axis values.
|
|
GetYCurrentRange
|
GetYCurrentRange ( self )
Returns (minY, maxY) y-axis for currently displayed portion of graph
|
|
GetYMaxRange
|
GetYMaxRange ( self )
Returns (minY, maxY) y-axis range for displayed graph
|
|
GetYSpec
|
GetYSpec ( self )
Returns current YSpec for axis
|
|
OnMotion
|
OnMotion ( self, event )
event handlers **********************************
|
|
OnMouseDoubleClick
|
OnMouseDoubleClick ( self, event )
|
|
OnMouseLeftDown
|
OnMouseLeftDown ( self, event )
|
|
OnMouseLeftUp
|
OnMouseLeftUp ( self, event )
|
|
OnMouseRightDown
|
OnMouseRightDown ( self, event )
|
|
OnPaint
|
OnPaint ( self, event )
|
|
OnSize
|
OnSize ( self, event )
|
|
PageSetup
|
PageSetup ( self )
Brings up the page setup dialog
|
|
PrintPreview
|
PrintPreview ( self )
Print-preview current plot.
|
|
Printout
|
Printout ( self, paper=None )
Print current plot.
|
|
Redraw
|
Redraw ( self, dc=None )
Redraw the existing plot.
|
|
Reset
|
Reset ( self )
Unzoom the plot.
|
|
ScrollRight
|
ScrollRight ( self, units )
Move view right number of axis units.
|
|
ScrollUp
|
ScrollUp ( self, units )
Move view up number of axis units.
|
|
SetEnableGrid
|
SetEnableGrid ( self, value )
Set True to enable grid.
Exceptions
|
|
TypeError, "Value should be True or False"
|
|
|
SetEnableLegend
|
SetEnableLegend ( self, value )
Set True to enable legend.
Exceptions
|
|
TypeError, "Value should be True or False"
|
|
|
SetEnableZoom
|
SetEnableZoom ( self, value )
Set True to enable zooming.
Exceptions
|
|
TypeError, "Value should be True or False"
|
|
|
SetFontSizeAxis
|
SetFontSizeAxis ( self, point=10 )
Set the tick and axis label font size (default is 10 point)
|
|
SetFontSizeLegend
|
SetFontSizeLegend ( self, point=7 )
Set Legend font size (default is 7 point)
|
|
SetFontSizeTitle
|
SetFontSizeTitle ( self, point=15 )
Set Title font size (default is 15 point)
|
|
SetXSpec
|
SetXSpec ( self, type='auto' )
xSpec- defines x axis type. Can be none , min or auto
where:
none - shows no axis or tick mark values
min - shows min bounding box values
auto - rounds axis range to sensible values
|
|
SetYSpec
|
SetYSpec ( self, type='auto' )
ySpec- defines x axis type. Can be none , min or auto
where:
none - shows no axis or tick mark values
min - shows min bounding box values
auto - rounds axis range to sensible values
|
|
Zoom
|
Zoom (
self,
Center,
Ratio,
)
Zoom on the plot
Centers on the X,Y coords given in Center
Zooms by the Ratio = (Xratio, Yratio) given
|
|
__init__
|
__init__ (
self,
parent,
id=-1,
pos=wx.wxDefaultPosition,
size=wx.wxDefaultSize,
style=wx.wxDEFAULT_FRAME_STYLE,
name="",
)
Constucts a window, which can be a child of a frame, dialog or
any other non-control window
|
|
_axisInterval
|
_axisInterval (
self,
spec,
lower,
upper,
)
Returns sensible axis range for given spec
Exceptions
|
|
ValueError, str( spec ) + ': illegal axis specification'
|
|
|
_drawAxes
|
_drawAxes (
self,
dc,
p1,
p2,
scale,
shift,
xticks,
yticks,
)
|
|
_drawLegend
|
_drawLegend (
self,
dc,
graphics,
rhsW,
topH,
legendBoxWH,
legendSymExt,
legendTextExt,
)
Draws legend symbols and text
Exceptions
|
|
TypeError, "object is neither PolyMarker or PolyLine instance"
|
|
|
_drawRubberBand
|
_drawRubberBand (
self,
corner1,
corner2,
)
Draws/erases rect box from corner1 to corner2
|
|
_getFont
|
_getFont ( self, size )
Take font size, adjusts if printing and returns wxFont
|
|
_legendWH
|
_legendWH (
self,
dc,
graphics,
)
Returns the size in screen units for legend box
|
|
_point2ClientCoord
|
_point2ClientCoord (
self,
corner1,
corner2,
)
Converts user point coords to client screen coords x,y,width,height
|
|
_printDraw
|
_printDraw ( self, printDC )
Used for printing.
|
|
_setPrinterScale
|
_setPrinterScale ( self, scale )
Used to thicken lines and increase marker size for print out.
|
|
_setSize
|
_setSize (
self,
width=None,
height=None,
)
DC width and height.
Private Methods **************************************************
|
|
_ticks
|
_ticks (
self,
lower,
upper,
)
|
|
_titleLablesWH
|
_titleLablesWH (
self,
dc,
graphics,
)
Draws Title and labels and returns width and height for each
|