From e78ae8cd9fec9fe163b35b371807dc481b84abf2 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 26 Mar 2012 17:18:59 -0400 Subject: [PATCH] Plotting commands now return the plots they generate. This lets you manipulate them in external code to fine tune them to your particular situation. The default plots are useful, but not always beautiful. Now you can write a script to generate beautiful plots for your poster without duplicating code from the plot functions. --- calibcant/analyze.py | 1 + calibcant/bump_analyze.py | 1 + calibcant/temperature_analyze.py | 1 + calibcant/vibration_analyze.py | 1 + 4 files changed, 4 insertions(+) diff --git a/calibcant/analyze.py b/calibcant/analyze.py index 1774c0b..67d6908 100644 --- a/calibcant/analyze.py +++ b/calibcant/analyze.py @@ -183,6 +183,7 @@ def plot(bumps, temperatures, vibrations): if hasattr(figure, 'show'): figure.show() + return figure _plot = plot # alternative name for use inside analyze_all() diff --git a/calibcant/bump_analyze.py b/calibcant/bump_analyze.py index d5256fc..babcb05 100644 --- a/calibcant/bump_analyze.py +++ b/calibcant/bump_analyze.py @@ -400,4 +400,5 @@ def plot(data, yguess=None, yfit=None): residual_axes.set_ylabel('Photodiode (Volts)') if hasattr(figure, 'show'): figure.show() + return plot _plot = plot # alternative name for use inside fit() diff --git a/calibcant/temperature_analyze.py b/calibcant/temperature_analyze.py index 1cca2c9..7e48adc 100644 --- a/calibcant/temperature_analyze.py +++ b/calibcant/temperature_analyze.py @@ -159,3 +159,4 @@ def plot(raw=None, processed=None): axes2.plot(processed, label='processed') if hasattr(figure, 'show'): figure.show() + return figure diff --git a/calibcant/vibration_analyze.py b/calibcant/vibration_analyze.py index 8959d37..0cfb27c 100644 --- a/calibcant/vibration_analyze.py +++ b/calibcant/vibration_analyze.py @@ -559,4 +559,5 @@ def plot(deflection=None, freq_axis=None, power=None, A=None, B=None, freq_axes.set_ylabel('PSD') if hasattr(figure, 'show'): figure.show() + return figure _plot = plot # alternative name for use inside analyze() -- 2.26.2