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

Skip to content

Commit 3dbda0b

Browse files
committed
pep8 and unused var
1 parent d44cf96 commit 3dbda0b

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

examples/color/named_colors.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@
4141
ncols = 4
4242
nrows = int(np.ceil(1. * n / ncols))
4343

44-
X = [(0., 0.08, 0.1),
45-
(0.33, 0.41, 0.43),
46-
(0.66, 0.74, 0.76)]
47-
48-
4944
fig = plt.figure()
5045
ax = fig.add_subplot(111)
5146

@@ -56,15 +51,14 @@
5651
# col width
5752
w = X / ncols
5853

59-
6054
for i, (name, color) in enumerate(sorted_colors):
6155
col = i % ncols
6256
row = int(i / ncols)
6357
y = Y - (row * h) - h
6458

65-
xi_text = w * (col + 0.3)
6659
xi_line = w * (col + 0.05)
67-
xf_line = w * (col + 0.25)
60+
xf_line = w * (col + 0.25)
61+
xi_text = w * (col + 0.3)
6862

6963
ax.text(xi_text, y, name, fontsize=(h * 0.8),
7064
horizontalalignment='left',
@@ -74,10 +68,11 @@
7468
# clear colors more visible.
7569
ax.hlines(y, xi_line, xf_line, color='black', linewidth=(h * 0.7))
7670
ax.hlines(y + h * 0.1, xi_line, xf_line, color=color, linewidth=(h * 0.6))
71+
7772
ax.set_xlim(0, X)
7873
ax.set_ylim(0, Y)
7974
ax.set_axis_off()
80-
75+
8176
fig.subplots_adjust(left=0, right=1,
8277
top=1, bottom=0,
8378
hspace=0, wspace=0)

0 commit comments

Comments
 (0)