From 7b9cdcc69a1fd157a644edbf00fa4f6ebdeb0767 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 4 May 2013 18:16:24 -0400 Subject: [PATCH] vibration_analyze: Only highlight the frequency range if we have a config You shouldn't have to mock up a config dictionary just to plot the PSD. With this commit, you can skip config if you just want a quick-and-dirty plot. --- calibcant/vibration_analyze.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/calibcant/vibration_analyze.py b/calibcant/vibration_analyze.py index 9d2fa29..487d027 100644 --- a/calibcant/vibration_analyze.py +++ b/calibcant/vibration_analyze.py @@ -536,12 +536,13 @@ def plot(deflection=None, freq_axis=None, power=None, A=None, B=None, freq_axes.autoscale(tight=True) xmin,xmax = freq_axes.get_xbound() ymin,ymax = freq_axes.get_ybound() - + # highlight the region we're fitting - freq_axes.axvspan( - config['minimum-fit-frequency'], - config['maximum-fit-frequency'], - facecolor='g', alpha=0.1, zorder=-2) + if config: + freq_axes.axvspan( + config['minimum-fit-frequency'], + config['maximum-fit-frequency'], + facecolor='g', alpha=0.1, zorder=-2) if A is not None: fitdata = breit_wigner(freq_axis, A, B, C, D) -- 2.26.2