SplinePlot (hwx.gui)#

class SplinePlot(splineEditor, **kwds)#

Bases: XyPlot

Plot for the SplineEditor.

Plots the curve points, an interpolated spline and the derivative.

Method Table#

Name

Description

createSplineCurves (self)

onDrag (self, event)

User is dragging one or more points.

onModified (self, event)

Mouse up after a drag.

onSelected (self, event)

Points selected in the plot, select the points in the table.

selectPoints (self, indexes)

Cells selected from the table, select the points in the plot.

setEventDx (self, event)

Limit dx moves so we dont get a bad spline.

setInterpolationMethod (self, method)

Sets the interpolation method

setInterpolationNpts (self, npts)

setPlotTitle (self, obj)

setReadOnly (self, readOnly)

setSpline (self, spline, fit=True)

Sets the specified spline in SplinePlot.

Example

from hwx.gui import SplineEditor as se
splineEditor = se.SplineEditor()
splinePlot = se.SplinePlot(splineEditor)
show(splinePlot)
setSpline(spline, fit=True)#

Sets the specified spline in SplinePlot.

Parameters:
  • spline (Spline) – The spline containing X and Y values to be set.

  • fit (bool) – Determines whether to fit the plot or not.

selectPoints(indexes)#

Cells selected from the table, select the points in the plot.

Parameters:

indexes (list) – list of point index to be selected.

onSelected(event)#

Points selected in the plot, select the points in the table.

Parameters:

event (MouseEvent) – Mouse event to get all the selected points in the plot.

onDrag(event)#

User is dragging one or more points.

Parameters:

event (MouseEvent) – Mouse event to get all the selected points in the plot.

onModified(event)#

Mouse up after a drag.

Parameters:

event (MouseEvent) – Mouse event to get all the selected points in the plot.

setEventDx(event)#

Limit dx moves so we dont get a bad spline.

spline.xs must increase in value so user can not drag selected points past the unselected points.

Parameters:

event (MouseEvent) – Mouse event to get all the selected points in the plot.

setInterpolationMethod(method)#

Sets the interpolation method

Parameters:

method (str) – The interpolation method. Possible choices are “akima”, “linear”, “cubic”, “zero”, “natural”. If it is None, turns off the interpolate and derivative curves.