October 2018
Beginner to intermediate
676 pages
18h 30m
English
The following code block draws a table chart for the types of batteries sold in each year:
rows = ['2011', '2012', '2013', '2014', '2015']columns = ('7Ah', '35Ah', '40Ah', '135Ah', '150Ah')data = [[75, 144, 114, 102, 108], [90, 126, 102, 84, 126], [96, 114, 75, 105, 135], [105, 90, 150, 90, 75], [90, 75, 135, 75, 90]]
values = np.arange(0, 600, 100)
colors = plt.cm.OrRd(np.linspace(0, 0.5, len(rows)))
index = np.arange(len(columns)) + 0.3bar_width = 0.5
Read now
Unlock full access