|
17 | 17 | data = np.concatenate((spread, center, flier_high, flier_low), 0)
|
18 | 18 |
|
19 | 19 | fig1, ax1 = plt.subplots()
|
20 |
| -ax1.set_title('basic plot') |
| 20 | +ax1.set_title('Basic Plot') |
21 | 21 | ax1.boxplot(data)
|
22 |
| -#fig1.savefig('box1') |
23 | 22 |
|
24 | 23 | fig2, ax2 = plt.subplots()
|
25 |
| -ax2.set_title('notched plot') |
| 24 | +ax2.set_title('Notched boxes') |
26 | 25 | ax2.boxplot(data, notch=True)
|
27 |
| -#fig2.savefig('box2') |
28 | 26 |
|
29 | 27 | green_diamond = dict(markerfacecolor='g', marker='D')
|
30 | 28 | fig3, ax3 = plt.subplots()
|
31 |
| -ax3.set_title('changed outlier point symbols') |
| 29 | +ax3.set_title('Changed Outlier Symbols') |
32 | 30 | ax3.boxplot(data, flierprops=green_diamond)
|
33 |
| -#fig3.savefig('box3') |
34 | 31 |
|
35 | 32 | fig4, ax4 = plt.subplots()
|
36 |
| -ax4.set_title('hide show outlier points') |
| 33 | +ax4.set_title('Hide Outlier Points') |
37 | 34 | ax4.boxplot(data, showfliers=False)
|
38 |
| -#fig4.savefig('box4') |
39 | 35 |
|
40 | 36 | red_square = dict(markerfacecolor='r', marker='s')
|
41 | 37 | fig5, ax5 = plt.subplots()
|
42 |
| -ax5.set_title('horizontal boxes') |
| 38 | +ax5.set_title('Horizontal Boxes') |
43 | 39 | ax5.boxplot(data, vert=False, flierprops=red_square)
|
44 |
| -#fig5.savefig('box5') |
45 | 40 |
|
46 | 41 | fig6, ax6 = plt.subplots()
|
47 |
| -ax6.set_title('shorter whisker length') |
| 42 | +ax6.set_title('Shorter Whisker Length') |
48 | 43 | ax6.boxplot(data, flierprops=red_square, vert=False, whis=0.75)
|
49 |
| -#fig6.savefig('box6') |
50 | 44 |
|
51 | 45 | # fake up some more data
|
52 | 46 | spread = np.random.rand(50) * 100
|
|
63 | 57 | # a 2-D array into a list of vectors internally anyway.
|
64 | 58 | data = [data, d2, d2[::2,0]]
|
65 | 59 | fig7, ax7 = plt.subplots()
|
66 |
| -ax7.set_title('multiple samples with different sizes') |
| 60 | +ax7.set_title('Multiple Samples with Different sizes') |
67 | 61 | ax7.boxplot(data)
|
68 |
| -#fig.savefig('box7') |
69 | 62 |
|
70 | 63 | plt.show()
|
0 commit comments