Timeseries Plotter¶
Plotting support for time series energy properties.
- class kbkit.visualization.timeseries.TimeseriesPlotter(props: SystemProperties, start_time: int = 0)[source]¶
Bases:
objectPlotting timeseries of energy properties for a given simulations.
- Parameters:
props (SystemProperties) – SystemProperties object for a given molecular dynamics system.
start_time (int) – Initial time for plotting.
- classmethod from_collection(systems: SystemCollection, system_name: str | int, start_time: int = 0) TimeseriesPlotter[source]¶
Initialized TimeseriesPlotter from a
SystemCollectionobject.- Parameters:
collection (SystemCollection) – SystemCollection object for a given set of systems.
system (str | int) – Name or index of system in SystemCollection.
start_time (int) – Initial time for plotting.
- Returns:
Initialized TimeseriesPlotter object.
- Return type:
- plot(name: str, units: str | None = None, show_avg: bool = True, figsize: tuple = (9, 4), xlabel: str = 'Time (ns)', ylabel: str | None = None, title: str | None = None, ylim: tuple | None = None, xlim: tuple | None = None, savepath: str | Path | None = None, show: bool = True, **kwargs)[source]¶
Create a timeseries plot for a given energy property.
Optionally, visualize the running average of the property and report average on figure legend.
- Parameters:
name (str) – Name of property to plot.
units (str, optional) – Units of desired property. If not provided, property will be displayed in default units.
show_avg (bool, optional) – Add the running average and the averaged property to the figure.
figsize (tuple, optional) – Size of the figure to display (height, width).
xlabel (str, optional) – Label for x-axis.
ylabel (str, optional) – Label for y-axis.
title (str, optional) – Title label.
ylim (tuple, optional) – Limits for y-axis.
xlim (tuple, optional) – Limits for x-axis.
savepath (str | Path, optional) – Path to save figure.
show (bool, optional) – Display the figure.