|
1 | 1 | ''' |
2 | | -For each colormap, plot the lightness parameter L* from CIELAB colorspace along the y axis vs index through the colormap. Colormaps are examined in categories as in the original matplotlib gallery of colormaps. |
| 2 | +For each colormap, plot the lightness parameter L* from CIELAB colorspace |
| 3 | +along the y axis vs index through the colormap. Colormaps are examined in |
| 4 | +categories as in the original matplotlib gallery of colormaps. |
3 | 5 | ''' |
4 | 6 |
|
5 | 7 | from skimage import color |
|
47 | 49 |
|
48 | 50 | # Do subplots so that colormaps have enough space. 5 per subplot? |
49 | 51 | dsub = 5 # number of colormaps per subplot |
50 | | - if cmap_category == 'Diverging': # because has 13 colormaps |
| 52 | + if cmap_category == 'Diverging': # because has 12 colormaps |
| 53 | + dsub = 6 |
| 54 | + elif cmap_category == 'Sequential (2)': |
51 | 55 | dsub = 6 |
52 | | - elif cmap_category == 'Sequential2': |
53 | | - dsub = 7 |
54 | 56 | elif cmap_category == 'Sequential': |
55 | 57 | dsub = 7 |
56 | 58 | nsubplots = int(np.ceil(len(cmap_list)/float(dsub))) |
|
84 | 86 | ax.axis([-0.1,4.7,0,100]) |
85 | 87 | locs.append(x[-1]+j*dc) # store locations for colormap labels |
86 | 88 |
|
87 | | - elif cmap_category=='Sequential2': |
| 89 | + elif cmap_category=='Sequential (2)': |
88 | 90 | dc = 1.15 |
89 | 91 | ax.scatter(x+j*dc, lab[0,:,0], c=x, cmap=cmap, s=300, linewidths=0.) |
90 | | - if i==0: |
91 | | - ax.axis([-0.1,8.1,0,100]) |
92 | | - else: |
93 | | - ax.axis([-0.1,7.0,0,100]) |
| 92 | + ax.axis([-0.1,7.0,0,100]) |
94 | 93 | locs.append(x[-1]+j*dc) # store locations for colormap labels |
95 | 94 |
|
96 | 95 | elif cmap_category=='Diverging': |
97 | 96 | dc = 1.2 |
98 | 97 | ax.scatter(x+j*dc, lab[0,:,0], c=x, cmap=cmap, s=300, linewidths=0.) |
99 | | - if i==0: |
100 | | - ax.axis([-0.1,7.1,0,100]) |
101 | | - else: |
102 | | - ax.axis([-0.1,6,0,100]) |
| 98 | + ax.axis([-0.1,7.1,0,100]) |
103 | 99 | locs.append(x[int(x.size/2.)]+j*dc) # store locations for colormap labels |
104 | 100 |
|
105 | 101 | elif cmap_category=='Qualitative': |
|
0 commit comments