File: show_colormaps.py

package info (click to toggle)
basemap 1.2.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 212,272 kB
  • sloc: python: 9,541; ansic: 266; makefile: 39; sh: 23
file content (19 lines) | stat: -rw-r--r-- 563 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from __future__ import (absolute_import, division, print_function)

import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import cm
a=np.outer(np.arange(0,1,0.01),np.ones(10))
plt.figure(figsize=(10,7))
plt.subplots_adjust(top=0.8,bottom=0.05,left=0.01,right=0.99)
maps=[m for m in cm.datad.keys() if not m.endswith("_r")]
maps.sort()
l=len(maps)+1
i=1
for m in maps:
    plt.subplot(1,l,i)
    plt.axis("off")
    plt.imshow(a,aspect='auto',cmap=cm.__dict__[m],origin="lower")
    plt.title(m,rotation=90,fontsize=10)
    i=i+1
plt.show()