We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 721fc04 commit 99b2957Copy full SHA for 99b2957
1 file changed
examples/color/named_colors.py
@@ -25,18 +25,18 @@
25
26
n = len(sorted_names)
27
ncols = 4
28
-nrows = n // ncols + 1
+nrows = n // ncols
29
30
-fig, ax = plt.subplots(figsize=(8, 5))
+fig, ax = plt.subplots(figsize=(12, 10))
31
32
# Get height and width
33
X, Y = fig.get_dpi() * fig.get_size_inches()
34
h = Y / (nrows + 1)
35
w = X / ncols
36
37
for i, name in enumerate(sorted_names):
38
- col = i % ncols
39
- row = i // ncols
+ row = i % nrows
+ col = i // nrows
40
y = Y - (row * h) - h
41
42
xi_line = w * (col + 0.05)
@@ -48,7 +48,7 @@
48
verticalalignment='center')
49
50
ax.hlines(y + h * 0.1, xi_line, xf_line,
51
- color=colors[name], linewidth=(h * 0.6))
+ color=colors[name], linewidth=(h * 0.8))
52
53
ax.set_xlim(0, X)
54
ax.set_ylim(0, Y)
0 commit comments