File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ #issue https://github.com/matplotlib/matplotlib/issues/2164
2
+
3
+ import numpy as np
4
+ import matplotlib .pyplot as plt
5
+ from matplotlib .colors import cnames
6
+ from itertools import chain
7
+
8
+ print len (cnames .keys ())
9
+ n = len (cnames )
10
+ ncols = n / 15
11
+ nrows = n / ncols
12
+ names = cnames .keys ()
13
+ colors = cnames .values ()
14
+
15
+ fig , axes_ = plt .subplots (nrows = nrows , ncols = ncols )
16
+ axes = list (chain (* axes_ ))
17
+
18
+ for i in range (n ):
19
+ title = axes [i ].set_title (names [i ])
20
+ title .set_size ('xx-small' )
21
+ axes [i ].set_axis_bgcolor (colors [i ])
22
+ axes [i ].spines ['right' ].set_visible (False )
23
+ axes [i ].spines ['top' ].set_visible (False )
24
+ axes [i ].spines ['bottom' ].set_visible (False )
25
+ axes [i ].spines ['left' ].set_visible (False )
26
+ axes [i ].set_xticks ([])
27
+ axes [i ].set_yticks ([])
28
+
29
+ # axes[i].set_label(names[i])
30
+
31
+ # for axes in list(chain(*axes_)):
32
+ # axes.set_axis_off()
33
+
34
+ # print nrows, ncols, fig, axes
35
+ plt .show ()
You can’t perform that action at this time.
0 commit comments