nspyre.gui.widgets.heatmap

Module Contents

Classes

HeatMapWidget

Qt widget for displaying 2D data using pyqtgraph ImageView.

class nspyre.gui.widgets.heatmap.HeatMapWidget(*args, title='', btm_label='', lft_label='', colormap=None, font=nspyre_font, **kwargs)

Qt widget for displaying 2D data using pyqtgraph ImageView.

Parameters:
  • title (str) – Plot title.

  • btm_label (str) – Plot bottom axis label.

  • lft_label (str) – Plot left axis label.

  • colormap – pyqtgraph ColorMap object.

  • font (pyqtgraph.Qt.QtGui.QFont) – Font to use in the plot title, axis labels, etc., although the font type may not be fully honored.

new_data

Qt Signal emitted when new data is available.

setup()

Subclasses should override this function to perform any setup code.

update()

Subclasses should override this function to update the plot. This function will be run in a separate Thread.

teardown()

Subclasses should override this function to perform any teardown code.

set_data(xs, ys, data, zs=None)

Queue up x,y,z and data to update the color map. Threadsafe.

Parameters:
  • name – Name of the plot.

  • xs – Array-like of data for the x-axis.

  • ys – Array-like of data for the y-axis.

  • data – 2D or 3D array with the data to be plotted. For a 2D imge, data’s rows should correspond to the y-axis and the columns should correspond to the x-axis. Moreover, xs should be the same length as the number of columns of data, and ys should be the same length as the number of rows of data. This way, when the widget attempts to display the pixel at (x, y), it looks for it in data[y][x]. In the case of a 3D array, the z-axis information should be in the last index, so that the pixel at (x, y, z) is stored in data[y][x][z].

  • zs – Optional array-like of data for the z-axis.

Raises:

ValueError – An error with the supplied arguments.