lstein.lstein.LSteinPlotly

class lstein.lstein.LSteinPlotly(LSC: LSteinCanvas)[source]

represents plotly backend for plotting LStein

  • plotly backend to show an LSteinCanvas with all its LSteinPanel elements

  • ax is a method argument to ensure signature equivalence of different backends

  • LStein is mainly developed for matplotlib
    • some arguments might not work
      • have not been dealt with in translate_kwargs()

      • especially relevant for annotations (tick labels, axis labels, …)

Attributes
  • LSC – see __init__()

Inferred Attributes

Methods
  • add_xaxis()

  • add_thetaaxis()

  • add_yaxis()

  • add_ylabel()

  • add_yaxis()

  • scatter_()

  • plot_()

  • show()

Dependencies
  • logging

  • matplotlib

  • numpy

__init__(LSC: LSteinCanvas)[source]

constructor

  • initializes class

Parameters
  • LSC
    • LSteinCanvas

    • canvas to display

Raises

Returns

Methods

__init__(LSC)

constructor

add_thetaaxis(fig, row, col)

adds theta-axis to fig

add_xaxis(fig, row, col)

adds x-axis to fig

add_yaxis(LSP, pkwargs, fig, row, col)

adds y-axis of LSP to fig

add_ylabel(fig, row, col)

adds y-label to fig

plot_(fig, row, col, x, y, *args, **kwargs)

adds a lineplot of x and y to fig

scatter_(fig, row, col, x, y, *args, **kwargs)

adds a scatterplot of x and y to fig

show(fig, row, col)

display LStein plot in fig

translate_kwargs()

translates kwargs from matplotlib to plotly names

add_thetaaxis(fig: Figure, row: int, col: int)[source]

adds theta-axis to fig

  • method to add the theta-axis to fig

Parameters
  • fig
    • Figure

    • plotly figure to draw into

  • row
    • int

    • row of the panel to plot into

  • col
    • int

    • column of the panel to plot into

Raises

Returns

add_xaxis(fig: Figure, row: int, col: int)[source]

adds x-axis to fig

  • method to add the x-axis to fig

Parameters
  • fig
    • Figure

    • plotly figure to draw into

  • row
    • int

    • row of the panel to plot into

  • col
    • int

    • column of the panel to plot into

Raises

Returns

add_yaxis(LSP: LSteinPanel, pkwargs: Dict[str, Dict], fig: Figure, row: int, col: int)[source]

adds y-axis of LSP to fig

  • method to add the y-axis of LSP to fig

Parameters
  • fig
    • Figure

    • plotly figure to draw into

  • row
    • int

    • row of the panel to plot into

  • col
    • int

    • column of the panel to plot into

Raises

Returns

add_ylabel(fig: Figure, row: int, col: int)[source]

adds y-label to fig

  • method to add the y-label to fig

Parameters
  • fig
    • Figure

    • plotly figure to draw into

  • row
    • int

    • row of the panel to plot into

  • col
    • int

    • column of the panel to plot into

Raises

Returns

plot_(fig: Figure, row: int, col: int, x: ndarray, y: ndarray, *args, **kwargs)[source]

adds a lineplot of x and y to fig

  • method to add a lineplot

  • only to be called from within LSteinPlotly.show()

Parameters
  • fig
    • Figure

    • plotly figure to draw into

  • row
    • int

    • row of the panel to plot into

  • col
    • int

    • column of the panel to plot into

  • x
    • np.ndarray

    • x-values of the series

    • has to have same length as y

  • y
    • np.ndarray

    • y-values of the series

    • has to have same length as x

-kwargs
  • kwargs to pass to go.Scatter()

Raises

Returns

scatter_(fig: Figure, row: int, col: int, x: ndarray, y: ndarray, *args, **kwargs)[source]

adds a scatterplot of x and y to fig

  • method to add a scatterplot

  • only to be called from within LSteinPlotly.show()

Parameters
  • fig
    • Figure

    • plotly figure to draw into

  • row
    • int

    • row of the panel to plot into

  • col
    • int

    • column of the panel to plot into

  • x
    • np.ndarray

    • x-values of the series

    • has to have same length as y

  • y
    • np.ndarray

    • y-values of the series

    • has to have same length as x

-kwargs
  • kwargs to pass to go.Scatter()

Raises

Returns

show(fig: Figure, row: int, col: int) Figure[source]

display LStein plot in fig

  • method to display self.LSC within a plotly figure

  • will
    • draw the canvas

    • add each panel

    • plot series for each panel

Parameters
  • fig
    • Figure

    • plotly figure to draw into

  • row
    • int

    • row of the panel to plot into

  • col
    • int

    • column of the panel to plot into

Raises

Returns
  • fig
    • go.Figure

    • fig with the respective elements added

translate_kwargs()[source]

translates kwargs from matplotlib to plotly names

  • method to translate default kwargs specified in LSteinCanvas and LSteinPanel to plotly
    • original kwargs are specified in matplotlib

  • overrides any relevant …kwargs attribute of self.LSC

  • currently included
    • the default values for the kwargs

    • some commonly used values

Parameters

Raises

Returns