# rectangular box plot bplot1 = axes[0].boxplot(all_data, vert=True, # vertical box alignment patch_artist=True, # fill with color labels=labels) # will be used to label x-ticks axes[0].set_title('Rectangular box plot')
# notch shape box plot bplot2 = axes[1].boxplot(all_data, notch=True, # notch shape vert=True, # vertical box alignment patch_artist=True, # fill with color labels=labels) # will be used to label x-ticks axes[1].set_title('Notched box plot')
# fill with colors colors = ['pink', 'lightblue', 'lightgreen'] for bplot in (bplot1, bplot2): for patch, color inzip(bplot['boxes'], colors): patch.set_facecolor(color)
# adding horizontal grid lines for ax in axes: ax.yaxis.grid(True) ax.set_xlabel('Three separate samples') ax.set_ylabel('Observed values')