Commit d47dd169 authored by Markus Mirz's avatar Markus Mirz

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.figure(figure_id)
plt.plot(time_series.time, time_series.values, linestyle=plt_linestyle, label=time_series.label)
plt.gca().autoscale(axis='x', tight=True)
plt.legend()
def plot_in_subplots(figure_id, time_series, plt_linestyle='-'):
plt.figure(figure_id)
for ts in time_series:
plt.subplot(len(time_series), 1, time_series.index(ts) + 1)
plt.plot(ts.time, ts.values, linestyle=plt_linestyle, label=ts.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)
plt.legend()
else:
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)
plt.legend()
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