From d2b5eb2b43f746a13f307a03538eb5f4abec837b Mon Sep 17 00:00:00 2001 From: Luke Date: Wed, 1 Aug 2018 13:40:10 -0700 Subject: [PATCH] Minor styling changes --- LPRDefaultPlotting.py | 10 ++++++++++ parsePy.py | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/LPRDefaultPlotting.py b/LPRDefaultPlotting.py index 071b661..641bcf0 100644 --- a/LPRDefaultPlotting.py +++ b/LPRDefaultPlotting.py @@ -121,3 +121,13 @@ def figAnnotateClear(hobj): for child in children: if type(child) == matplotlib.text.Text: child.remove() + +def annotateArrow(ha, y, x_list, direction='right'): + x=[min(x_list), max(x_list)] + if direction == 'right': + x=[x[-1], x[0]] + + ha.annotate("", + xy=(x[0], y), xycoords='data', + xytext=(x[1], y), textcoords='data', + arrowprops=dict(width=2, headwidth=8, headlength=6, facecolor='black')) diff --git a/parsePy.py b/parsePy.py index 24f08e8..db0f260 100755 --- a/parsePy.py +++ b/parsePy.py @@ -279,6 +279,9 @@ for filename in os.listdir(source_directory): # Recall that the ylimits should be 0-360 basically. aT.set_ylabel('RMS Error (deg)') aT.plot(imeas.f, ang_rms) + marker_freq = 27.5 + marker_point = np.argmin(np.abs(imeas.f-marker_freq)) + marker_height = ang_rms[marker_point] # The goal is to take the usual step size of 50, # and then equate that with a 1-degree step in RMS Error @@ -304,6 +307,8 @@ for filename in os.listdir(source_directory): aT.get_lines()[0].set_linewidth(2.0) aT.get_lines()[0].set_linestyle('-.') aT.get_lines()[0].set_color('black') + LPRDefaultPlotting.annotateArrow(aT, marker_height, \ + [marker_freq+0.05, marker_freq+0.25]) for aT in ax: aT.set_xlabel('Frequency (GHz)') aT.grid()