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

Stem plot

Graphe qui représente une barre verticale par point à la coordonnée indiquée (voir ci-dessous pour un exemple) :
Exemple de stem plot : pyplot.stem(range(5), [x ** 2 for x in range(5)], markerfmt = 'ro', linefmt = 'g--', basefmt = 'm:', use_line_collection = True) pyplot.margins(0.1, 0.1) pyplot.title('stem avec configuration simple') pyplot.ylabel('valeurs')
On peut aussi donner des propriétés beaucoup plus détaillées avec la fonction setp :
Exemple avec configuration détaillée : (markerLines, stemLines, baseLines) = pyplot.stem([x ** 1.2 for x in range(5)], [x ** 2 for x in range(5)], use_line_collection = True) pyplot.setp(markerLines, color = 'cyan', markersize = 20, markeredgecolor = 'blue', markeredgewidth = 3) pyplot.setp(stemLines, color = 'green', linewidth = 3, linestyle = 'dashdot') pyplot.setp(baseLines, color = 'red', linewidth = 2, linestyle = 'dashed') pyplot.margins(0.1, 0.1) pyplot.title('stem avec configuration detaillee') pyplot.ylabel('valeurs')

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