Signals

MatplotlibCurveWidget provides the following PyQt signals:

selectedIndicesUpdated[list, array]: Update with selected points indices and list of selected points from lasso selector tool.

xyposUpdated[float, float]: Update the current mouse position in the figure data coordinate, represented by two float numbers for x and y positions.

Slots

MatplotlibCurveWidget provides the following PyQt slots:

Category I

These slots are not exposed to the Property Editor column of designer:

MatplotlibCurveWidget.add_curve(x_data=None, y_data=None, **kws)

Add one curve to figure, accepts all pyplot.plot keyword arguments, see matplotlib.pyplot.plot.

Parameters:
  • x_data (list or array) – Array of x data.

  • y_data (list or array) – Array of y data.

Returns:

o – The added line object.

Return type:

Line2D

MatplotlibCurveWidget.setLineID(i)

Set line id, which is used to discriminate one from another, the first drawn line is of index 0, next one is 1, and so on.

Parameters:

i (int) – Line index number.

See also

add_curve

Add a new curve onto the widget.

MatplotlibCurveWidget.setXData(x)

Set x data for the current curve, signal type should be QVariant.

Parameters:

x (list or array) – Array of x data.

MatplotlibCurveWidget.setYData(x)

Set y data for the current curve, signal type should be QVariant.

Parameters:

x (list or array) – Array of y data.

Category II

These slots are exposed to the Property Editor column of designer:

MatplotlibCurveWidget.setTightLayoutToggle(f)

Toggle for the tight layout.

Parameters:

f (bool) – Tight layout toggle.

MatplotlibCurveWidget.setFigureMTicksToggle(f)

Toggle for the minor ticks.

Note

Before toggle on, be sure the axis scale is linear.

Parameters:

f (bool) – Minor ticks on/off toggle.

MatplotlibCurveWidget.setFigureGridToggle(f, **kws)

Toggle for the figure grid.

Parameters:

f (bool) – Figure grid toggle.

MatplotlibCurveWidget.setLegendToggle(f)

Toggle for figure legend.

Parameters:

f (bool) – Figure legend on/off toggle.

MatplotlibCurveWidget.setLegendLocation(i)

Set legend location.

Parameters:

i (int) – Index number of legend location, see matplotlib.pyplot.legend.

MatplotlibCurveWidget.setFigureGridColor(c, **kws)

Set color for the grid line.

Parameters:

c (QColor) – Color of the grid line.

MatplotlibCurveWidget.setFigureWidth(w)

Set figure width in inch.

Parameters:

w (float) – Figure width in inch (>= 2.0).

MatplotlibCurveWidget.setFigureHeight(h)

Set figure height in inch.

Parameters:

h (float) – Figure height in inch (>= 2.0).

MatplotlibCurveWidget.setFigureDpi(d)

Set figure dpi.

Parameters:

d (float) – Figure dpi in [50.0, 600.0].

MatplotlibCurveWidget.setFigureXYlabelFont(font)

Set font for x and y labels.

Parameters:

font (QFont) – Font to set.

MatplotlibCurveWidget.setFigureXYticksFont(font)

Set font for the tick labels.

Parameters:

font (QFont) – Font to set.

MatplotlibCurveWidget.setFigureTitleFont(font)

Set font for figure title.

Parameters:

font (QFont) – Font to set.

MatplotlibCurveWidget.setFigureBgColor(color)

Set figure background color.

Parameters:

color (QColor) – Color to set.

MatplotlibCurveWidget.setFigureXYticksColor(color)

Set color for the ticks.

Parameters:

color (QColor) – Color to set.

MatplotlibCurveWidget.setLineColor(c)

Set line color for the current curve.

Parameters:

c (QColor) – Color to set.

MatplotlibCurveWidget.setMkEdgeColor(c)

Set marker edgecolor.

Parameters:

c (QColor) – Color to set.

MatplotlibCurveWidget.setMkFaceColor(c)

Set marker facecolor.

Parameters:

c (QColor) – Color to set.

MatplotlibCurveWidget.setLineStyle(s)

Set line style for the current curve.

Parameters:

s (str) – String for the line style, see line style.

MatplotlibCurveWidget.setMarkerStyle(s)

Set marker style.

Parameters:

s (str) – String for the marker style, see marker style.

MatplotlibCurveWidget.setMarkerThickness(x)

Set the thickness of marker.

Parameters:

x (float) – Number for marker thickness.

MatplotlibCurveWidget.setLineLabel(s)

Set label for current curve.

Parameters:

s (str) – Label string which will be shown as legend.

MatplotlibCurveWidget.setLineWidth(x)

Set line width for the current curve.

Parameters:

x (float) – Line width.

MatplotlibCurveWidget.setMarkerSize(x)

Set marker size.

Parameters:

x (float) – Marker size.

MatplotlibCurveWidget.setFigureAutoScale(f)

Set xy limits as autoscale or not.

Parameters:

f (bool) – Toggle for the autoscale.

MatplotlibCurveWidget.setFigureTitle(s)

Set figure title.

Parameters:

s (str) – Title for the figure.

MatplotlibCurveWidget.setFigureXlabel(s)

Set xlabel string.

Parameters:

s (str) – String for xlabel.

MatplotlibCurveWidget.setFigureYlabel(s)

Set ylabel string.

Parameters:

s (str) – String for ylabel.

MatplotlibCurveWidget.setXLimitMin(x=None)

Set minimum of xlimit.

Parameters:

x (float) – Minimum of xlimit.

MatplotlibCurveWidget.setXLimitMax(x=None)

Set maximum of xlimit.

Parameters:

x (float) – Maximum of xlimit.

MatplotlibCurveWidget.setYLimitMin(y=None)

Set minimum of ylimit.

Parameters:

y (float) – Minimum of ylimit.

MatplotlibCurveWidget.setYLimitMax(y=None)

Set maximum of ylimit.

Parameters:

y (float) – Maximum of ylimit.