- import matplotlib.pyplot as plt
- # пример с категориями и значениями в отдельных списках
- categories = ['Category1', 'Category2', 'Category3']
- values = [20, 35, 30]
- plt.bar(categories, values)
- # цикл по значениям, чтобы каждое поставить над столбиком, по центру
- for i in range(len(values)):
- plt.text(x = i, y = values[i]+0.5, s = values[i], ha = 'center')
- plt.show()
Re: Untitled
From Gray Tern, 3 Months ago, written in Plain Text, viewed 74 times.
This paste is a reply to Untitled from Insensitive Agouti
- view diff
URL http://codebin.org/view/c6883977
Embed
Download Paste or View Raw
— Expand Paste to full width of browser