Minor styling changes

This commit is contained in:
Luke 2018-08-01 13:40:10 -07:00
parent 54f1c18e07
commit d2b5eb2b43
2 changed files with 15 additions and 0 deletions

View file

@ -121,3 +121,13 @@ def figAnnotateClear(hobj):
for child in children: for child in children:
if type(child) == matplotlib.text.Text: if type(child) == matplotlib.text.Text:
child.remove() 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'))

View file

@ -279,6 +279,9 @@ for filename in os.listdir(source_directory):
# Recall that the ylimits should be 0-360 basically. # Recall that the ylimits should be 0-360 basically.
aT.set_ylabel('RMS Error (deg)') aT.set_ylabel('RMS Error (deg)')
aT.plot(imeas.f, ang_rms) 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, # The goal is to take the usual step size of 50,
# and then equate that with a 1-degree step in RMS Error # 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_linewidth(2.0)
aT.get_lines()[0].set_linestyle('-.') aT.get_lines()[0].set_linestyle('-.')
aT.get_lines()[0].set_color('black') aT.get_lines()[0].set_color('black')
LPRDefaultPlotting.annotateArrow(aT, marker_height, \
[marker_freq+0.05, marker_freq+0.25])
for aT in ax: for aT in ax:
aT.set_xlabel('Frequency (GHz)') aT.set_xlabel('Frequency (GHz)')
aT.grid() aT.grid()