From: W. Trevor King Date: Mon, 26 Mar 2012 21:18:59 +0000 (-0400) Subject: Plotting commands now return the plots they generate. X-Git-Tag: 0.8~25 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e78ae8cd9fec9fe163b35b371807dc481b84abf2;p=calibcant.git 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. --- 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()