python::plot::PlotCanvas Class Reference

Subclass of a wx.Window to allow simple general plotting of data with zoom, labels, and automatic axis scaling. More...

Inheritance diagram for python::plot::PlotCanvas:

Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
 Constucts a window, which can be a child of a frame, dialog or any other non-control window.
def SaveFile
 Saves the file to the type specified in the extension.
def PageSetup
 Brings up the page setup dialog.
def Printout
 Print current plot.
def PrintPreview
 Print-preview current plot.
def SetFontSizeAxis
 Set the tick and axis label font size (default is 10 point).
def GetFontSizeAxis
 Get current tick and axis label font size in points.
def SetFontSizeTitle
 Set Title font size (default is 15 point).
def GetFontSizeTitle
 Get current Title font size in points.
def SetFontSizeLegend
 Set Legend font size (default is 7 point).
def GetFontSizeLegend
 Get current Legend font size in points.
def SetEnableZoom
 Set True to enable zooming.
def GetEnableZoom
 True if zooming enabled.
def SetEnableGrid
 Set True to enable grid.
def GetEnableGrid
 True if grid enabled.
def SetEnableLegend
 Set True to enable legend.
def GetEnableLegend
 True if Legend enabled.
def SetEnablePointLabel
 Set True to enable pointLabel.
def GetEnablePointLabel
 True if pointLabel enabled.
def SetPointLabelFunc
 Sets the function with custom code for pointLabel drawing ******** more info needed ***************.
def GetPointLabelFunc
 Returns pointLabel Drawing Function.
def Reset
 Unzoom the plot.
def ScrollRight
 Move view right number of axis units.
def ScrollUp
 Move view up number of axis units.
def GetXY
 Takes a mouse event and returns the XY user axis values.
def PositionUserToScreen
 Converts User position to Screen Coordinates.
def PositionScreenToUser
 Converts Screen position to User Coordinates.
def SetXSpec
 xSpec- defines x axis type.
def SetYSpec
 ySpec- defines x axis type.
def GetXSpec
 Returns current XSpec for axis.
def GetYSpec
 Returns current YSpec for axis.
def GetXMaxRange
 Returns (minX, maxX) x-axis range for displayed graph.
def GetYMaxRange
 Returns (minY, maxY) y-axis range for displayed graph.
def GetXCurrentRange
 Returns (minX, maxX) x-axis for currently displayed portion of graph.
def GetYCurrentRange
 Returns (minY, maxY) y-axis for currently displayed portion of graph.
def SetXUseScopeTicks
 Always 10 divisions, no labels.
def GetXUseScopeTicks
def Draw
 Draw objects in graphics with specified x and y axis.
def Redraw
 Redraw the existing plot.
def Clear
 Erase the window.
def Zoom
 Zoom on the plot Centers on the X,Y coords given in Center Zooms by the Ratio = (Xratio, Yratio) given.
def GetClosestPoints
 Returns list with [curveNumber, legend, index of closest point, pointXY, scaledXY, distance] list for each curve.
def GetClosetPoint
 Returns list with [curveNumber, legend, index of closest point, pointXY, scaledXY, distance] list for only the closest curve.
def UpdatePointLabel
 Updates the pointLabel point on screen with data contained in mDataDict.
def OnMotion
def OnMouseLeftDown
def OnMouseLeftUp
def OnMouseDoubleClick
def OnMouseRightDown
def OnPaint
def OnSize
def OnLeave
 Used to erase pointLabel when mouse outside window.

Public Attributes

 border
 print_data
 pageSetupData
 printerScale
 parent
 last_draw
 last_PointLabel
 preview
 height
 plotbox_size
 plotbox_origin


Detailed Description

Subclass of a wx.Window to allow simple general plotting of data with zoom, labels, and automatic axis scaling.


Member Function Documentation

def python::plot::PlotCanvas::__init__ (   self,
  parent,
  id = -1,
  pos = wx.DefaultPosition,
  size = wx.DefaultSize,
  style = wx.DEFAULT_FRAME_STYLE,
  name = "" 
)

Constucts a window, which can be a child of a frame, dialog or any other non-control window.

def python::plot::PlotCanvas::Clear (   self  ) 

Erase the window.

def python::plot::PlotCanvas::Draw (   self,
  graphics,
  xAxis = None,
  yAxis = None,
  dc = None,
  step = 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

def python::plot::PlotCanvas::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

def python::plot::PlotCanvas::GetClosetPoint (   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

def python::plot::PlotCanvas::GetEnableGrid (   self  ) 

True if grid enabled.

def python::plot::PlotCanvas::GetEnableLegend (   self  ) 

True if Legend enabled.

def python::plot::PlotCanvas::GetEnablePointLabel (   self  ) 

True if pointLabel enabled.

def python::plot::PlotCanvas::GetEnableZoom (   self  ) 

True if zooming enabled.

def python::plot::PlotCanvas::GetFontSizeAxis (   self  ) 

Get current tick and axis label font size in points.

def python::plot::PlotCanvas::GetFontSizeLegend (   self  ) 

Get current Legend font size in points.

def python::plot::PlotCanvas::GetFontSizeTitle (   self  ) 

Get current Title font size in points.

def python::plot::PlotCanvas::GetPointLabelFunc (   self  ) 

Returns pointLabel Drawing Function.

def python::plot::PlotCanvas::GetXCurrentRange (   self  ) 

Returns (minX, maxX) x-axis for currently displayed portion of graph.

def python::plot::PlotCanvas::GetXMaxRange (   self  ) 

Returns (minX, maxX) x-axis range for displayed graph.

def python::plot::PlotCanvas::GetXSpec (   self  ) 

Returns current XSpec for axis.

def python::plot::PlotCanvas::GetXUseScopeTicks (   self  ) 

def python::plot::PlotCanvas::GetXY (   self,
  event 
)

Takes a mouse event and returns the XY user axis values.

def python::plot::PlotCanvas::GetYCurrentRange (   self  ) 

Returns (minY, maxY) y-axis for currently displayed portion of graph.

def python::plot::PlotCanvas::GetYMaxRange (   self  ) 

Returns (minY, maxY) y-axis range for displayed graph.

def python::plot::PlotCanvas::GetYSpec (   self  ) 

Returns current YSpec for axis.

def python::plot::PlotCanvas::OnLeave (   self,
  event 
)

Used to erase pointLabel when mouse outside window.

def python::plot::PlotCanvas::OnMotion (   self,
  event 
)

def python::plot::PlotCanvas::OnMouseDoubleClick (   self,
  event 
)

def python::plot::PlotCanvas::OnMouseLeftDown (   self,
  event 
)

def python::plot::PlotCanvas::OnMouseLeftUp (   self,
  event 
)

def python::plot::PlotCanvas::OnMouseRightDown (   self,
  event 
)

def python::plot::PlotCanvas::OnPaint (   self,
  event 
)

def python::plot::PlotCanvas::OnSize (   self,
  event 
)

def python::plot::PlotCanvas::PageSetup (   self  ) 

Brings up the page setup dialog.

def python::plot::PlotCanvas::PositionScreenToUser (   self,
  pntXY 
)

Converts Screen position to User Coordinates.

def python::plot::PlotCanvas::PositionUserToScreen (   self,
  pntXY 
)

Converts User position to Screen Coordinates.

def python::plot::PlotCanvas::Printout (   self,
  paper = None 
)

Print current plot.

def python::plot::PlotCanvas::PrintPreview (   self  ) 

Print-preview current plot.

def python::plot::PlotCanvas::Redraw (   self,
  dc = None 
)

Redraw the existing plot.

def python::plot::PlotCanvas::Reset (   self  ) 

Unzoom the plot.

def python::plot::PlotCanvas::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 sucessful, 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.

def python::plot::PlotCanvas::ScrollRight (   self,
  units 
)

Move view right number of axis units.

def python::plot::PlotCanvas::ScrollUp (   self,
  units 
)

Move view up number of axis units.

def python::plot::PlotCanvas::SetEnableGrid (   self,
  value 
)

Set True to enable grid.

def python::plot::PlotCanvas::SetEnableLegend (   self,
  value 
)

Set True to enable legend.

def python::plot::PlotCanvas::SetEnablePointLabel (   self,
  value 
)

Set True to enable pointLabel.

def python::plot::PlotCanvas::SetEnableZoom (   self,
  value 
)

Set True to enable zooming.

def python::plot::PlotCanvas::SetFontSizeAxis (   self,
  point = 10 
)

Set the tick and axis label font size (default is 10 point).

def python::plot::PlotCanvas::SetFontSizeLegend (   self,
  point = 7 
)

Set Legend font size (default is 7 point).

def python::plot::PlotCanvas::SetFontSizeTitle (   self,
  point = 15 
)

Set Title font size (default is 15 point).

def python::plot::PlotCanvas::SetPointLabelFunc (   self,
  func 
)

Sets the function with custom code for pointLabel drawing ******** more info needed ***************.

def python::plot::PlotCanvas::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

def python::plot::PlotCanvas::SetXUseScopeTicks (   self,
  v = False 
)

Always 10 divisions, no labels.

def python::plot::PlotCanvas::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

def python::plot::PlotCanvas::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.

def python::plot::PlotCanvas::Zoom (   self,
  Center,
  Ratio 
)

Zoom on the plot Centers on the X,Y coords given in Center Zooms by the Ratio = (Xratio, Yratio) given.


Member Data Documentation


The documentation for this class was generated from the following file:

Generated on Thu Mar 5 09:04:01 2009 for GNU Radio 3.1.3 by  doxygen 1.5.8