Package Scientific :: Package QtWidgets :: Module QtPlotCanvas :: Class PlotCanvas
[hide private]
[frames] | no frames]

Class PlotCanvas



qt_fake.QWidget --+
                  |
                 PlotCanvas

Qt plot widget

PlotCanvas objects support all operations of Qt widgets.

Instance Methods [hide private]
  __init__(self, parent=None, background='white', font=None, zoom=False, select=None)
  _autoScale(self)
  _axisInterval(self, spec, lower, upper)
  _drawAxes(self, painter, xaxis, yaxis, bb1, bb2, scale, shift, xticks, yticks)
  _hideValue(self)
  _popupMenu(self, event)
  _setsize(self)
  _showValue(self, x, y)
  _textBoundingBox(self, painter, text)
  _ticks(self, lower, upper)
  _xmgr(self)
  clear(self)
Clear the canvas
  draw(self, graphics, xaxis=None, yaxis=None)
Draw something on the canvas
  mouseMoveEvent(self, event)
  mousePressEvent(self, event)
  mouseReleaseEvent(self, event)
  paintEvent(self, event)
  redraw(self)
Redraw the most recent canvas contents
  resizeEvent(self, event)
  select(self, range)
Highlight a range on the x-axis

Class Variables [hide private]
  _multiples = [(2.0, 0.3010299956639812), (5.0, 0.69897000433601886)]

Method Details [hide private]

__init__(self, parent=None, background='white', font=None, zoom=False, select=None)
(Constructor)

 
Parameters:
  • parent - the parent widget
  • background (str) - the background color
  • font (QFont) - the font for axis labels, default: 10 point Helevetica
  • attr - widget attributes
  • zoom (bool) - a flag that indicates whether interactive zooming (using the left mouse button) is enabled; the default is False (no zoom)
  • select - enables the user to select a range along the x axis by dragging the mouse (with the left button pressed) in the area under the x axis. If select is 0, no selection is possible. Otherwise the value of select must be a callable object that is called whenever the selection changes, with a single argument that can be None (no selection) or a tuple containing two x values.

_autoScale(self)

 

_axisInterval(self, spec, lower, upper)

 

_drawAxes(self, painter, xaxis, yaxis, bb1, bb2, scale, shift, xticks, yticks)

 

_hideValue(self)

 

_popupMenu(self, event)

 

_setsize(self)

 

_showValue(self, x, y)

 

_textBoundingBox(self, painter, text)

 

_ticks(self, lower, upper)

 

_xmgr(self)

 

clear(self)

 

Clear the canvas

draw(self, graphics, xaxis=None, yaxis=None)

 

Draw something on the canvas
Parameters:
  • graphics - the graphics object (PolyLine, PolyMarker, or PlotGraphics) to be drawn
  • xaxis - None (no x-axis), "automatic" (automatic scaling), or a pair (x1, x2) defining the range of the x-axis
  • yaxis - None (no y-axis), "automatic" (automatic scaling), or a pair (y1, y2) defining the range of the y-axis

mouseMoveEvent(self, event)

 

mousePressEvent(self, event)

 

mouseReleaseEvent(self, event)

 

paintEvent(self, event)

 

redraw(self)

 

Redraw the most recent canvas contents

resizeEvent(self, event)

 

select(self, range)

 

Highlight a range on the x-axis
Parameters:
  • range - the range on the x-axis to be highlighted. It can be None (no selection) or a sequence of two values on the x-axis.

Class Variable Details [hide private]

_multiples

Value:
[(2.0, 0.3010299956639812), (5.0, 0.69897000433601886)]