LinePlot

class specviz.core.plots.LinePlot(layer, plot=None, visible=True, style=u'line', pen=None, err_pen=None, color=(0, 0, 0))[source]

Bases: object

Plot representation of a layer

Parameters:
  • layer (Spectrum1DRefLayer) – The layer to plot
  • plot (LinePlot) – LinePlot instance to reuse.
  • visible (bool) – If True, the plot will be visible
  • style (str) – The plotting style
  • pen (str) – If defined, the pen style to use.
  • err_pen (str) – If defined, the pen style to use for the error/uncertainty.

Attributes Summary

error_pen
layer
pen
plot

Methods Summary

change_units(x[, y, z]) Change the displayed units
from_layer(layer, \*\*kwargs) Create a LinePlot from a layer
set_error_visibility([show]) Show the error/uncertainty
set_line_width(width) Set the line plot width
set_mode(mode) Set the line plotting mode
set_plot_visibility([show, inactive]) Set visibility and active state
update([autoscale]) Refresh the plot

Attributes Documentation

error_pen
layer
pen
plot

Methods Documentation

change_units(x, y=None, z=None)[source]

Change the displayed units

Parameters:
  • x (units) – The new units for the dispersion
  • y (units) – The new units for the flux
  • z (units) – The new units for the multi-spectral dimension.
static from_layer(layer, **kwargs)[source]

Create a LinePlot from a layer

Parameters:
  • layer (Spectrum1DRefLayer) – The layer to create from.
  • kwargs (dict) – Other arguments for LinePlot class.
Returns:

The new LinePlot

Return type:

plot_container

set_error_visibility(show=None)[source]

Show the error/uncertainty

Parameters:show (bool) – If True, show the error/uncertainty info.
set_line_width(width)[source]

Set the line plot width

Parameters:width (float) – The width of the line
set_mode(mode)[source]

Set the line plotting mode

Parameters:mode ('line' | 'scatter | 'histogram') – The plot mode
set_plot_visibility(show=None, inactive=None)[source]

Set visibility and active state

Parameters:
  • show (bool) – If True, show the plot
  • inactive (bool) – If True, set plot style to indicate this is not the active plot.
update(autoscale=False)[source]

Refresh the plot

Parameters:autoscale (bool) – If True, rescale the plot to match the data.