ScatterLayerState¶
- class glue.viewers.scatter.state.ScatterLayerState(viewer_state=None, layer=None, **kwargs)[source]¶
Bases:
MatplotlibLayerState
A state class that includes all the attributes for layers in a scatter plot.
Attributes Summary
The transparency used to display the data
The colormap to use (when in colormap mode)
The attribute to use for the color
Whether to use color to encode an attribute
The upper level for the colormap
The lower level for the colormap
The color used to display the data
The dynamic range of the density map
Whether to show the points as a density map
Whether to fill the markers
Whether to show a line connecting all positions
The line style
The line width
Whether to show markers
Whether to use markers or a density map
The size of the markers
The attribute to use for the size
Whether to use size to encode an attribute
Relative scaling of the size
The upper level for the size mapping
The lower level for the size mapping
The stretch used to render the layer, which should be one of
linear
,sqrt
,log
, orarcsinh
Whether to show vector arrow
Whether to plot the vectors in cartesian or polar mode
Whether to place the vector so that the origin is at the tail, middle, or tip
The relative scaling of the arrow length
Whether to show vector plot
Whether the layer is currently visible
The attribute to use for the x vector arrow
The attribute to use for the y vector arrow
The attribute to use for the x error bars
Whether to show x error bars
The attribute to use for the y error bars
Whether to show y error bars
A value used to indicate which layers are shown in front of which (larger zorder values are on top of other layers)
Methods Summary
add_callback
(name, callback[, echo_old, ...])Add a callback that gets triggered when a callback property of the class changes.
add_global_callback
(callback)Add a global callback function, which is a callback that gets triggered when any callback properties on the class change.
as_dict
()Return the current state as a dictionary of attribute/value pairs.
Remove all global and property-specific callbacks.
compute_density_map
([bins, range])Flip the cmap_vmin/cmap_vmax limits.
Flip the size_vmin/size_vmax limits.
is_callback_property
(name)Whether a property (identified by name) is a callback property.
Iterator to loop over all callback properties.
remove_callback
(name, callback)Remove a previously-added callback
remove_global_callback
(callback)Remove a global callback function.
update_from_dict
(properties)Update this state using the values from a dictionary of attributes.
update_from_state
(state)Update this state using the values from another state.
Attributes Documentation
- alpha¶
The transparency used to display the data
- cmap¶
The colormap to use (when in colormap mode)
- cmap_att¶
The attribute to use for the color
- cmap_mode¶
Whether to use color to encode an attribute
- cmap_vmax¶
The upper level for the colormap
- cmap_vmin¶
The lower level for the colormap
- color¶
The color used to display the data
- density_contrast¶
The dynamic range of the density map
- density_map¶
Whether to show the points as a density map
- fill¶
Whether to fill the markers
- line_visible¶
Whether to show a line connecting all positions
- linestyle¶
The line style
- linewidth¶
The line width
- markers_visible¶
Whether to show markers
- points_mode¶
Whether to use markers or a density map
- size¶
The size of the markers
- size_att¶
The attribute to use for the size
- size_mode¶
Whether to use size to encode an attribute
- size_scaling¶
Relative scaling of the size
- size_vmax¶
The upper level for the size mapping
- size_vmin¶
The lower level for the size mapping
- stretch¶
The stretch used to render the layer, which should be one of
linear
,sqrt
,log
, orarcsinh
- vector_arrowhead¶
Whether to show vector arrow
- vector_mode¶
Whether to plot the vectors in cartesian or polar mode
- vector_origin¶
Whether to place the vector so that the origin is at the tail, middle, or tip
- vector_scaling¶
The relative scaling of the arrow length
- vector_visible¶
Whether to show vector plot
- visible¶
Whether the layer is currently visible
- vx_att¶
The attribute to use for the x vector arrow
- vy_att¶
The attribute to use for the y vector arrow
- xerr_att¶
The attribute to use for the x error bars
- xerr_visible¶
Whether to show x error bars
- yerr_att¶
The attribute to use for the y error bars
- yerr_visible¶
Whether to show y error bars
- zorder¶
A value used to indicate which layers are shown in front of which (larger zorder values are on top of other layers)
Methods Documentation
- add_callback(name, callback, echo_old=False, priority=0)¶
Add a callback that gets triggered when a callback property of the class changes.
- Parameters:
- namestr
The instance to add the callback to.
- callbackfunc
The callback function to add
- echo_oldbool, optional
If True, the callback function will be invoked with both the old and new values of the property, as
callback(old, new)
. If False (the default), will be invoked ascallback(new)
- priorityint, optional
This can optionally be used to force a certain order of execution of callbacks (larger values indicate a higher priority).
- add_global_callback(callback)¶
Add a global callback function, which is a callback that gets triggered when any callback properties on the class change.
- Parameters:
- callbackfunc
The callback function to add
- as_dict()¶
Return the current state as a dictionary of attribute/value pairs.
- callback_properties()¶
- clear_callbacks()¶
Remove all global and property-specific callbacks.
- is_callback_property(name)¶
Whether a property (identified by name) is a callback property.
- Parameters:
- namestr
The name of the property to check
- iter_callback_properties()¶
Iterator to loop over all callback properties.
- remove_callback(name, callback)¶
Remove a previously-added callback
- Parameters:
- namestr
The instance to remove the callback from.
- funcfunc
The callback function to remove
- remove_global_callback(callback)¶
Remove a global callback function.
- Parameters:
- callbackfunc
The callback function to remove
- update_from_dict(properties)¶
Update this state using the values from a dictionary of attributes.
- Parameters:
- propertiesdict
The dictionary containing attribute/value pairs.
- update_from_state(state)¶
Update this state using the values from another state.
- Parameters:
- state~glue.core.state_objects.State
The state to use the values from