helper function to try out different plot options
(data, plot_opts={}, jitter=False)
| 57 | |
| 58 | |
| 59 | def beanplot(data, plot_opts={}, jitter=False): |
| 60 | """helper function to try out different plot options""" |
| 61 | fig = plt.figure() |
| 62 | ax = fig.add_subplot(111) |
| 63 | plot_opts_ = { |
| 64 | "cutoff_val": 5, |
| 65 | "cutoff_type": "abs", |
| 66 | "label_fontsize": "small", |
| 67 | "label_rotation": 30, |
| 68 | } |
| 69 | plot_opts_.update(plot_opts) |
| 70 | sm.graphics.beanplot(data, |
| 71 | ax=ax, |
| 72 | labels=labels, |
| 73 | jitter=jitter, |
| 74 | plot_opts=plot_opts_) |
| 75 | ax.set_xlabel("Party identification of respondent.") |
| 76 | ax.set_ylabel("Age") |
| 77 | |
| 78 | |
| 79 | fig = beanplot(age, jitter=True) |
no test coverage detected
searching dependent graphs…