traceVisual

Module Contents

class TraceVisual(theData, theWGPlot, highlight_last)[source]

Bases: PyQt5.QtCore.QObject

Defines a trace in a graph.

class _ModifiedPaintElem[source]

Hidden class to manage brushes or pens

add_modified_paintElem(self, index, newPaintElem)[source]
modify_paintElems(self, paintElemsIn_List)[source]

Apply transformation to paintElemsIn_List

Parameters

paintElemsIn_List – list of brushes or pens to modify

Returns

False if nothing has been modified, True is something has been modified

reset_paintElem(self, index)[source]

Remove transformation of point index

reset(self)[source]
signal_must_update
hide_points(self)[source]

Hide all the points

get_color(self)[source]

Get colour of the trace, return tuple (r,g,b)

set_color(self, color)[source]

Set colour of the trace, argument as tuple (r,g,b)

get_base_symbol_brush(self)[source]

Get symbol brush configured for this trace, return pg.QBrush

get_base_pen(self)[source]

Get pen configured for this trace, return pg.QPen

get_base_symbol_pen(self)[source]

Get symbol pen configured for this trace, return pg.QPen

get_base_symbol(self)[source]

Get base symbol configured for this trace, return str of the symbol (e.g. ‘o’)

get_symbol(self, size)[source]

Get actual symbols for the trace. If the symbols have been modified: return a list which maps each points to a symbol. Otherwise: return :meth:TraceVisual.get_base_symbol()

updateTrace(self)[source]

Forces the trace to refresh.

get_length(self)[source]

Return number of data to plot

hide(self)[source]

Hides the trace

show(self)[source]

Shows the trace

toggle(self, boolean)[source]

Toggle the trace (hide/show)

get_data(self)[source]

Get data to plot Data

get_brushes(self, size)[source]

Get actual brushes for the trace (=symbol filling). return a list which maps each points to a symbol brush

set_brush(self, indexPoint, newbrush, update=True)[source]

Set the symbol brush for a specific point:

Parameters
  • indexPoint – Index of the point (in the graph) to modify

  • newbrush – either QBrush or tuple (r, g, b) of the new brush

  • update – if True, update the trace afterwards. This is slow operation.

set_symbol(self, indexPoint, newSymbol, update=True)[source]

Set the symbol shape for a specific point:

Parameters
  • indexPoint – Index of the point (in the graph) to modify

  • newSymbol – string of the new symbol (e.g.: ‘o’)

  • update – if True, update the trace afterwards. This is slow operation.

set_brushes(self, list_indexPoint, list_newbrush)[source]

Same as set_brush() but by taking a list as input

reset_brush(self, indexPoint, update=True)[source]

Reset the brush of the point indexpoint

reset_all_brushes(self)[source]

Reset all the brushes

reset_symbol(self, indexPoint, update=True)[source]

Reset the symbol shape of the point indexpoint

get_symbolPens(self, size)[source]

Get actual symbol pens for the trace (=symbol outline). return a list which maps each points to a symbol pen

set_symbolPen(self, indexPoint, newPen, update=True)[source]

Set the symbol shape for a specific point:

Parameters
  • indexPoint – Index of the point (in the graph) to modify

  • newPen – QPen item or tuple of the color (r,g,b)

  • update – if True, update the trace afterwards. This is slow operation.

set_symbolPens(self, list_indexPoint, list_newpens)[source]

Same as set_symbolPen() but by taking a list as input

reset_symbolPen(self, indexPoint)[source]

Reset the symbol pen of the point indexpoint

reset_all_symbolPens(self)[source]

Reset all the symbol pens

static set_pen_linestyle(thePen, linestyle)[source]

Transform a pen for dashed lines:

Parameters
  • thePen – QPen item

  • linestyle – str (e.g.: ‘.’, ‘.-‘, ‘–’, …)

get_point(self, indexPoint)[source]

Return object pyqtgraph.SpotItem