File: barh_demo.py

package info (click to toggle)
ipe-tools 20150406-3
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 532 kB
  • ctags: 618
  • sloc: cpp: 2,021; python: 1,525; ansic: 1,053; makefile: 72; sh: 11
file content (21 lines) | stat: -rw-r--r-- 524 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

"""
Simple demo of a horizontal bar chart.
"""
import matplotlib.pyplot as plt; plt.rcdefaults()
import numpy as np
import matplotlib.pyplot as plt


# Example data
people = ('Tom', 'Dick', 'Harry', 'Slim', 'Jim')
y_pos = np.arange(len(people))
performance = 3 + 10 * np.random.rand(len(people))
error = np.random.rand(len(people))

plt.barh(y_pos, performance, xerr=error, align='center', alpha=0.4)
plt.yticks(y_pos, people)
plt.xlabel('Performance')
plt.title('How fast do you want to go today?')