GUI routines
Contents:
2010-06-30 16:00 IJC: Figuring out how to select a position at a given location.
For an example of how this works:
import clickinput
coords = clickinput.picktest()
print “You finally picked a location, at: ”,coords
-
clickinput.fitparabola(*args, **kw)[source]
Fit a parabola to a data vector.
- INPUTS:
- Either y, or x,y – sequences of data
- OPTIONS:
- zoom : float or 2-sequence
- radii for zoom confirmation.
- xrange : float
- +/- range of x values for data to use in fit
- ax : matplotlib “axes” instance
- Where to plot: if None, create a new figure
- plotfit : bool
- Whether to plot fitted data
- OUTPUTS:
- fit : 3-sequence
- Best-fit parameters of parabola (suitable for
numpy.polyfit())
- REQUIREMENTS:
- :module:`numpy`
-
clickinput.pickloc(ax=None, zoom=10, resetaxes=False, titstr='click to select location')[source]
INPUTS: |
- ax : (axes instance)
axes in which to pick a location
- zoom : int or 2-tuple
zoom radius for target confirmation in x,y or both
- resetaxes : bool
whether to reset axes limits after selection
- titstr : str
String to initially display at title of plot.
Press enter/return to exit out, returning -1
NOTES: | Since I updated Matplotlib the “hit enter to exit”
functionality doesn’t work. Need to fix that.. |
|
-
clickinput.picktest(zoom=10)[source]
Set up a small, simple test and run PICKLOC on it.
-
clickinput.setuptest()[source]
Set up a small, simple test with which to test PICKLOC.