LinePlot

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

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
mask_pen
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_mask_visibility([show]) Show masked data
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
mask_pen
pen
plot

Methods Documentation

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

Change the displayed units. Note that if an axis is defined as unit- less, providing a new unit will defined that axis as being that unit.

Parameters:

x: `~astropy.units`

The new units for the dispersion

y: `~astropy.units`

The new units for the flux

z: `~astropy.units`

The new units for the multi-spectral dimension.

static from_layer(layer, **kwargs)[source] [edit on github]

Create a LinePlot from a layer

Parameters:

layer: `Spectrum1DRefLayer`

The layer to create from.

kwargs: dict

Other arguments for LinePlot class.

Returns:

plot_container:

The new LinePlot

set_error_visibility(show=None)[source] [edit on github]

Show the error/uncertainty

Parameters:

show: bool

If True, show the error/uncertainty info.

set_line_width(width)[source] [edit on github]

Set the line plot width

Parameters:

width: float

The width of the line

set_mask_visibility(show=None)[source] [edit on github]

Show masked data

Parameters:

show: bool

If True, display data points with mask value True.

set_mode(mode)[source] [edit on github]

Set the line plotting mode

Parameters:

mode: ‘line’ | ‘scatter | ‘histogram’

The plot mode

set_plot_visibility(show=None, inactive=None)[source] [edit on github]

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] [edit on github]

Refresh the plot

Parameters:

autoscale: bool

If True, rescale the plot to match the data.