| |
- Cursor
- HorizontalSpanSelector
- Widget
-
- Button
- CheckButtons
- RadioButtons
- Slider
- SubplotTool
class Button(Widget) |
|
A GUI neutral button
The following attributes are accesible
ax - the Axes the button renders into
label - a text.Text instance
color - the color of the button when not hovering
hovercolor - the color of the button when hovering
Call "on_clicked" to connect to the button |
|
Methods defined here:
- __init__(self, ax, label, image=None, color=0.84999999999999998, hovercolor=0.94999999999999996)
- ax is the Axes instance the button will be placed into
label is a string which is the button text
image if not None, is an image to place in the button -- can
be any legal arg to imshow (array, matplotlib Image
instance, or PIL image)
color is the color of the button when not activated
hovercolor is the color of the button when the mouse is over
it
- disconnect(self, cid)
- remove the observer with connection id cid
- on_clicked(self, func)
- When the button is clicked, call this func with event
A connection id is returned which can be used to disconnect
Data and other attributes inherited from Widget:
- drawon = True
- eventson = True
|
class CheckButtons(Widget) |
|
A GUI neutral radio button
The following attributes are exposed
ax - the Axes instance the buttons are in
labels - a list of text.Text instances
lines - a list of (line1, line2) tuples for the x's in the check boxes.
These lines exist for each box, but have set_visible(False) when
box is not checked
rectangles - a list of patch.Rectangle instances
Connect to the CheckButtons with the on_clicked method |
|
Methods defined here:
- __init__(self, ax, labels, actives)
- Add check buttons to axes.Axes instance ax
labels is a len(buttons) list of labels as strings
actives is a len(buttons) list of booleans indicating whether
the button is active
- disconnect(self, cid)
- remove the observer with connection id cid
- on_clicked(self, func)
- When the button is clicked, call this func with button label
A connection id is returned which can be used to disconnect
Data and other attributes inherited from Widget:
- drawon = True
- eventson = True
|
class Cursor |
|
A horizontal and vertical line span the axes that and move with
the pointer. You can turn off the hline or vline spectively with
the attributes
horizOn =True|False: controls visibility of the horizontal line
vertOn =True|False: controls visibility of the horizontal line
And the visibility of the cursor itself with visible attribute |
|
Methods defined here:
- __init__(self, ax, useblit=False, **lineprops)
- Add a cursor to ax. If useblit=True, use the backend
dependent blitting features for faster updates (GTKAgg only
now). lineprops is a dictionary of line properties. See
examples/widgets/cursor.py.
- clear(self, event)
- clear the cursor
- onmove(self, event)
- on mouse motion draw the cursor if visible
|
class HorizontalSpanSelector |
|
Select a min/max range of the x axes for a matplotlib Axes
Example usage:
ax = subplot(111)
ax.plot(x,y)
def onselect(xmin, xmax):
print xmin, xmax
span = HorizontalSpanSelector(ax, onselect) |
|
Methods defined here:
- __init__(self, ax, onselect, minspan=None, useblit=False, rectprops=None)
- Create a span selector in ax. When a selection is made, clear
the span and call onselect with
onselect(xmin, xmax)
and clear the span.
If minspan is not None, ignore events smaller than minspan
The span rect is drawn with rectprops; default
rectprops = dict(facecolor='red', alpha=0.5)
set the visible attribute to False if you want to turn off
the functionality of the span selector
- ignore(self, event)
- return True if event should be ignored
- onmove(self, event)
- on motion notify event
- press(self, event)
- on button press event
- release(self, event)
- on button release event
- update(self)
- draw using newfangled blit or oldfangled draw depending on useblit
- update_background(self, event)
- force an update of the background
|
class RadioButtons(Widget) |
|
A GUI neutral radio button
The following attributes are exposed
ax - the Axes instance the buttons are in
activecolor - the color of the button when clicked
labels - a list of text.Text instances
circles - a list of patch.Circle instances
Connect to the RadioButtons with the on_clicked method |
|
Methods defined here:
- __init__(self, ax, labels, active=0, activecolor='blue')
- Add radio buttons to axes.Axes instance ax
labels is a len(buttons) list of labels as strings
active is the index into labels for the button that is active
activecolor is the color of the button when clicked
- disconnect(self, cid)
- remove the observer with connection id cid
- on_clicked(self, func)
- When the button is clicked, call this func with button label
A connection id is returned which can be used to disconnect
Data and other attributes inherited from Widget:
- drawon = True
- eventson = True
|
class Slider(Widget) |
|
A slider representing a floating point range
The following attributes are defined
ax : the slider axes.Axes instance
val : the current slider value
vline : a Line2D instance representing the initial value
poly : A patch.Polygon instance which is the slider
valfmt : the format string for formatting the slider text
label : a text.Text instance, the slider label
closedmin : whether the slider is closed on the minimum
closedmax : whether the slider is closed on the maximum
slidermin : another slider - if not None, this slider must be > slidermin
slidermax : another slider - if not None, this slider must be < slidermax
dragging : allow for mouse dragging on slider
Call on_changed to connect to the slider event |
|
Methods defined here:
- __init__(self, ax, label, valmin, valmax, valinit=0.5, valfmt='%1.2f', closedmin=True, closedmax=True, slidermin=None, slidermax=None, dragging=True)
- Create a slider from valmin to valmax in axes ax;
valinit - the slider initial position
label - the slider label
valfmt - used to format the slider value
closedmin and closedmax - indicate whether the slider interval is closed
slidermin and slidermax - be used to contrain the value of
this slider to the values of other sliders.
- disconnect(self, cid)
- remove the observer with connection id cid
- on_changed(self, func)
- When the slider valud is changed, call this func with the new
slider position
A connection id is returned which can be used to disconnect
- reset(self)
- reset the slider to the initial value if needed
Data and other attributes inherited from Widget:
- drawon = True
- eventson = True
|
class SubplotTool(Widget) |
|
A tool to adjust to subplot params of fig |
|
Methods defined here:
- __init__(self, targetfig, toolfig)
- targetfig is the figure to adjust
toolfig is the figure to embed the the subplot tool into. If
None, a default pylab figure will be created. If you are
using this from the GUI
- funcbottom(self, val)
- funchspace(self, val)
- funcleft(self, val)
- funcright(self, val)
- functop(self, val)
- funcwspace(self, val)
Data and other attributes inherited from Widget:
- drawon = True
- eventson = True
|
class Widget |
|
OK, I couldn't resist; abstract base class for mpl GUI neutral
widgets |
|
Data and other attributes defined here:
- drawon = True
- eventson = True
| |