Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e8091cb

Browse files
Fixed flask8 errors
1 parent db70ca1 commit e8091cb

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

examples/lines_bars_and_markers/hat_graph.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,27 @@
77
import matplotlib
88
import numpy as np
99
import matplotlib.pyplot as plt
10-
# initialise labels and a numpy array make sure you have N labels of N number of values in the array
11-
labels = ['I', 'II','III','IV','V']
10+
# initialise labels and a numpy array make sure you have
11+
# N labels of N number of values in the array
12+
labels = ['I', 'II', 'III', 'IV', 'V']
1213
playerA = np.array([5, 15, 22, 20, 25])
1314
playerB = np.array([25, 32, 34, 30, 27])
1415
x = np.arange(len(labels))
1516
width = 0.35
16-
1717
fig, ax = plt.subplots()
1818
rects1 = ax.bar(x - width/2, np.zeros_like(playerA), width,
1919
bottom=playerA, label='Player A', fill=False)
2020
rects2 = ax.bar(x + width/2, playerB - playerA, width,
21-
bottom=playerA, label='Player B',edgecolor='black')
22-
#-----------------------------------------------------------------------------------------
21+
bottom=playerA, label='Player B', edgecolor='black')
2322
# Add some text for labels, title and custom x-axis tick labels, etc.
24-
ax.set_ylim(0,60)
23+
ax.set_ylim(0, 60)
2524
ax.set_ylabel('Score')
2625
ax.set_title('Scores by number of game and Players')
2726
ax.set_xticks(x)
2827
ax.set_xticklabels(labels)
2928
ax.legend()
3029
ax.set_xlabel('Games')
31-
#--------------------------------------------------------------------------------------------
32-
def Label(heights,rects):
30+
def Label(heights, rects):
3331
"""Attach a text label on top of each bar. """
3432
i=0
3533
for rect in rects:
@@ -40,8 +38,8 @@ def Label(heights,rects):
4038
xytext=(0, 4), # 4 points vertical offset.
4139
textcoords="offset points",
4240
ha='center', va='bottom')
43-
Label(playerA,rects1)
44-
Label(playerB,rects2)
41+
Label(playerA, rects1)
42+
Label(playerB, rects2)
4543
fig.tight_layout()
4644
plt.show()
4745
#############################################################################

0 commit comments

Comments
 (0)