diff --git a/villas/dataprocessing/plottools.py b/villas/dataprocessing/plottools.py index 06d46feb02c7f1bd6636164807587c4397d8dcae..b8b7d3790cc621d5fb9e1b55e4a7e355612ba7bc 100644 --- a/villas/dataprocessing/plottools.py +++ b/villas/dataprocessing/plottools.py @@ -4,7 +4,7 @@ from .timeseries import * import scipy.signal as signal -def plot_timeseries(figure_id, timeseries, marker='None', plt_linestyle='-', plt_linewidth=2, plt_color=None, plt_legend_loc='lower right', plt_legend=True, inlineLabel = False): +def plot_timeseries(figure_id, timeseries, marker='None', plt_linestyle='-', plt_linewidth=2, plt_color=None, plt_legend_loc='lower right', plt_legend=True, inlineLabel = False, inlinLabelPos=[-1,-1]): """ This function plots either a single timeseries or several timeseries in the figure defined by figure_id. Several timeseries (handed over in a list) are plotted in several subplots. @@ -30,7 +30,7 @@ def plot_timeseries(figure_id, timeseries, marker='None', plt_linestyle='-', plt if(plt_legend): plt.legend() if(inlineLabel): - plt.text(timeseries.time[-1], timeseries.values[-1], timeseries.label) + plt.text(timeseries.time[inlinLabelPos[0]], timeseries.values[inlinLabelPos[1]], timeseries.label) def set_timeseries_labels(timeseries, timeseries_labels): diff --git a/villas/dataprocessing/timeseries.py b/villas/dataprocessing/timeseries.py index c47fd713c70f174d7e59b8c8a4e1276f1e7d8290..c1180fabb55400c32c188d5f1a58bb46575f95a5 100644 --- a/villas/dataprocessing/timeseries.py +++ b/villas/dataprocessing/timeseries.py @@ -223,7 +223,9 @@ class TimeSeries: @staticmethod def rel_diff(name, ts1, ts2): - """Returns relative difference between two time series objects to the first. + """ + Returns relative difference between two time series objects to the first. + calculated against the max of ts1. """ diff_val=TimeSeries.diff('diff', ts1, ts2).values # relative error to the max value of ts1