-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path03-barplots-simple.py
60 lines (38 loc) · 1.54 KB
/
03-barplots-simple.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import matplotlib.pyplot as plt
def barplot_simple():
year = [2014, 2015, 2016, 2017, 2018, 2019]
tutorial_count = [39, 117, 111, 110, 67, 29]
plt.bar(year, tutorial_count)
plt.xlabel('Year')
plt.ylabel('Number of futurestud.io Tutorials')
plt.show()
def barplot_color():
year = [2014, 2015, 2016, 2017, 2018, 2019]
tutorial_count = [39, 117, 111, 110, 67, 29]
plt.bar(year, tutorial_count, color="#6c3376")
plt.xlabel('Year')
plt.ylabel('Number of futurestud.io Tutorials')
plt.show()
def barplot_color2():
year = [2014, 2015, 2016, 2017, 2018, 2019]
tutorial_count = [39, 117, 111, 110, 67, 29]
plt.bar(year, tutorial_count, color="#6c3376", edgecolor="#409240", linewidth=2)
plt.xlabel('Year')
plt.ylabel('Number of futurestud.io Tutorials')
plt.show()
def barplot_color3():
year = [2014, 2015, 2016, 2017, 2018, 2019]
tutorial_count = [39, 117, 111, 110, 67, 29]
plt.bar(year[:-1], tutorial_count[:-1], color="#6c3376")
plt.bar(year[-1], tutorial_count[-1], color="#6c3376", edgecolor="#409240", linewidth=2)
plt.xlabel('Year')
plt.ylabel('Number of futurestud.io Tutorials')
plt.show()
def barplot_horizontal():
year = [2014, 2015, 2016, 2017, 2018, 2019]
tutorial_count = [39, 117, 111, 110, 67, 29]
plt.barh(year[:-1], tutorial_count[:-1], color="#6c3376")
plt.barh(year[-1], tutorial_count[-1], color="#6c3376", edgecolor="#409240", linewidth=2)
plt.xlabel('Year')
plt.ylabel('Number of futurestud.io Tutorials')
plt.show()