Mis a jour le 2024-03-17, 13:2

Boxplot

boxplot (ou boîte à moustache) : Exemple : import numpy pyplot.subplot(121) pyplot.boxplot([[1, 2, 3, 4, 5, 13], [6, 7, 8, 10, 10, 11, 12], [1, 2, 3]]) pyplot.ylim(0, 14) pyplot.title('boxplot avec sequence') pyplot.subplot(122) pyplot.boxplot(numpy.array([[1, 2, 3], [2, 7, 8], [1, 3, 10], [2, 5, 12]])) pyplot.ylim(0, 14) pyplot.title('boxplot avec array 2d')
Paramètres simples de boxplot :
Configuration complète des boxplots :
Exemple avec un boxplot configuré : boxplotElements = pyplot.boxplot([[1, 2, 3, 4, 5, 13], [6, 7, 8, 10, 10, 11, 12], [1, 2, 3]], sym = 'g*', whis = 1.2, widths = [1, 0.5, 0.2], positions = [1, 3, 4], patch_artist = True) pyplot.gca().xaxis.set_ticklabels(['A', 'B', 'C']) for element in boxplotElements['medians']: element.set_color('blue') element.set_linewidth(4) for element in boxplotElements['boxes']: element.set_edgecolor('magenta') element.set_facecolor('yellow') element.set_linewidth(3) element.set_linestyle('dashed') element.set_fill(True) element.set_hatch('/') for element in boxplotElements['whiskers']: element.set_color('red') element.set_linewidth(2) for element in boxplotElements['caps']: element.set_color('cyan') pyplot.ylim(0, 14) pyplot.title('boxplot avec configuration complete')

Copyright python-simple.com
programmer en python, tutoriel python, graphes en python, Aymeric Duclert