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:
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']
|
post_update
|
Callable[[Self, int], None]
|
callback function for additional customization, by default |
lambda self, i: None
|
line_annots
|
bool
|
Sets line annotations leading the lines, by default |
True
|
legend
|
bool
|
Sets plot legend, by default True |
True
|
scatter_markers
|
bool
|
Enables line markers / Scatterplot, by default |
True
|
line_head
|
bool
|
Enables markers leading every line, by default |
True
|
fixed_xlim
|
bool
|
If False xlim will gradually change in every frame, by default |
True
|
fixed_ylim
|
bool
|
If False ylim will gradually change in every frame, by default |
False
|
xticks
|
bool
|
Sets xticks, by default |
True
|
yticks
|
bool
|
Sets yticks, by default |
True
|
grid
|
bool
|
Sets xgrid, by default |
True
|
post_update args
self: Lineplot instancei: Current frame index
example:
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) properties, 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)