Commit d47dd169 authored by Markus Mirz's avatar Markus Mirz
Browse files

plot_timeseries takes lists and scalars now; renamed old dpsim scripts

parent 3c8ada4f
......@@ -3,20 +3,20 @@ import numpy as np
from .timeseries import *
def plot_single_ts(figure_id, time_series, plt_linestyle='-'):
def plot_timeseries(figure_id, timeseries, plt_linestyle='-'):
plt.plot(time_series.time, time_series.values, linestyle=plt_linestyle, label=time_series.label)
if not isinstance(timeseries, list):
plt.plot(timeseries.time, timeseries.values, linestyle=plt_linestyle, label=timeseries.label)
plt.gca().autoscale(axis='x', tight=True)
def plot_in_subplots(figure_id, time_series, plt_linestyle='-'):
for ts in time_series:
plt.subplot(len(time_series), 1, time_series.index(ts) + 1)
for ts in timeseries:
plt.subplot(len(timeseries), 1, timeseries.index(ts) + 1)
plt.plot(ts.time, ts.values, linestyle=plt_linestyle, label=ts.label)
plt.gca().autoscale(axis='x', tight=True)
def set_time_series_labels(time_series, time_series_labels):
for ts in time_series:
ts.label = time_series_labels[time_series.index(ts)]
\ No newline at end of file
def set_time_series_labels(timeseries_list, time_series_labels):
for ts in timeseries_list:
ts.label = time_series_labels[timeseries_list.index(ts)]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment