def plot(self):
'''
This is a wrapper function to generate the complete sag plot.
It requires datasets with two keys, 'data' and 'heading'. The former should
contain all necessary information (as a subdictionary) to call all the _draw*
functions.
'''
plot_colours = ('r', 'b', 'g', 'y')
f, axes = plt.subplots(3, 1, figsize=(16,7))
ax = plt.subplot(1, 4, 1)
plt.tick_params(labelsize=10)
plt.rcParams.update({'axes.titlesize': 'small', 'axes.labelsize': 'small', 'xtick.labelsize':'small', 'ytick.labelsize':'small'})
for idx, d in enumerate(self.datasets):
self._drawLinearDisplacementsToAxis(ax, d['data']['x'], d['data']['y'],
d['data']['x_err'], d['data']['y_err'],
d['data']['mount_angles'], d['data']['fit_xc'],
d['data']['fit_yc'], d['data']['fit_r'],
d['heading'],
color=plot_colours[idx])
ax = plt.subplot(1, 4, 2, projection='polar')
for idx, d in enumerate(self.datasets):
self._drawRadialDisplacementsToAxis(ax, d['data']['xy_angles_from_12_o_clock'],
(d['data']['x'], d['data']['y']),
d['data']['mount_angles'], label=d['heading'],
color=plot_colours[idx])
ax = plt.subplot(1, 4, 3, projection='polar')
for idx, d in enumerate(self.datasets):
self._drawResidualsToAxis(ax, d['data']['xy_angles_from_12_o_clock'],
d['data']['residuals'], d['data']['mount_angles'],
label=d['heading'], color=plot_colours[idx])
ax = plt.subplot(1, 4, 4, projection='polar')
for idx, d in enumerate(self.datasets):
self._drawAnglesFromMountNormalToAxis(ax, d['data']['xy_angles_from_12_o_clock'],
[angle[2] for angle in
d['data']['angles_from_mount_normal']],
d['data']['mount_angles'],
label=d['heading'], color=plot_colours[idx])
评论列表
文章目录