Skip to content

Lineplot

See Baseplot for inherited modules.

Lineplot

Bases: Baseplot

Lineplot animation module that requires a valid time index.The data should be in this format where time is set to index

    Example:
    >>> time  col1 col2 col3 ...
    >>> 2012   1    0    2
    >>> 2013   2    3    1

Parameters:

Name Type Description Default
datafier LineDatafier

The datafier instance

required
palettes list[str]

List of color palettes to generate line / marker colors, by default ["viridis"]

['viridis']
post_update Callable[[__qualname__, int], None]

callback function for additional customization, by default lambda self, i: None

lambda self, i: None
line_annots bool

Sets line annotations leading the lines, by default True

True
legend bool

Sets plot legend, by default True

True
scatter_markers bool

Enables line markers / Scatterplot, by default True

True
line_head bool

Enables markers leading every line, by default True

True
fixed_xlim bool

If False xlim will gradually change in every frame, by default True

True
fixed_ylim bool

If False ylim will gradually change in every frame, by default False

False
xticks bool

Sets xticks, by default True

True
yticks bool

Sets yticks, by default True

True
grid bool

Sets xgrid, by default True

True

from_df(data, time_format, ip_freq, palettes=['viridis'], post_update=lambda self, i: None, line_annots=True, legend=True, scatter_markers=True, line_head=True, fixed_xlim=True, fixed_ylim=False, xticks=True, yticks=True, grid=True) classmethod

set_column_linestyles(linestyles)

Sets column linestyles. If linestyles is a list, length of linestyles should be equal to len(self.column_linestyles)

Parameters:

Name Type Description Default
linestyles Union[str, list[str], dict[str, str]]

Single linestyle str or list of linestyles or dict of column to linestyle mapping

required

set_line(**kwargs)

Sets line properties, addition kwargs are passed to ax.plot(**kwargs)

set_line_annots(callback=lambda col, val: f'{col}({human_readable(val)})', size=10, **kwargs)

Sets line annotation properties, additional kwargs are passed to ax.text(**kwargs). (Note these annotations are the texts leading the lines)

Parameters:

Name Type Description Default
callback Callable[[str, float], str]

Callback function for customizing the text, by default lambda col, val: f"{col}({human_readable(val)})"

lambda col, val: f'{col}({human_readable(val)})'
size float

Text size, by default 10

10

set_line_head(edgecolors='k', **kwargs)

Sets the line head(leading marker) properites, additional kwargs are passed to ax.scatter(**kwargs)

Parameters:

Name Type Description Default
edgecolors Union[str, list[str]]

Edge color of the point, by default "k"

'k'

set_marker(**kwargs)

Sets the line marker (scatterplot) properties, kwargs are passed to ax.scatter(**kwargs)

set_legend(**kwargs)

Sets legend properties, kwargs are passed to ax.legend(**kwargs)