Slider

class tfv.viewer.Slider(figure, range=array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99]), step=1, wait=0.01, format='num')

A class for a single slider object placed in the MPL toolbar, built with PyQt5.

Parameters:
  • figure (tuple) – Size of underlying figure as (width, height) in specified units

  • range (np.ndarray) – range of values that slider selects from

  • step (integer) – The step size of the slider, i.e. how manly values it skips

  • wait (float) – The wait time in seconds between each step when in ‘play’ mode

  • format ({'num', 'hms', '%d/%m/%Y %H:%M:%S', '%d-%m-%Y', '%H:%M:%S %d-%m-%Y', ...}) – The slider value display format. Any custom datetime format string can be passed in addition to ‘num’ for the python date time as a number and ‘hms’ for total hours, minutes and seconds.

value

The current value of the slider

Type:

float

index

The current index of the slider

Type:

integer

text

The display text of the slider

Type:

string

connect(function)

Connect function or handler value _changed event

disconnect(function)

Disconnect function or handler value _changed event

property figure

Matplotlib figure controlled by the slider.

property index

Current slider index.

property range

Array of values represented by the slider.

property text

Slider display text.

property value

Current slider value.