File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 2
2
Plot up stuff with colormaps.
3
3
'''
4
4
5
+ import sys
6
+
5
7
import numpy as np
6
8
import matplotlib as mpl
7
9
8
10
11
+ if sys .version_info > (3 ,):
12
+ _string_types = (str , np .str_ , np .unicode_ )
13
+ else :
14
+ _string_types = (basestring , np .str_ , np .unicode_ )
15
+
16
+
9
17
def print_colormaps (cmaps , N = 256 , returnrgb = True , savefiles = False ):
10
18
'''Print colormaps in 256 RGB colors to text files.
11
19
@@ -73,7 +81,7 @@ def cmap(rgbin, N=256):
73
81
'''
74
82
75
83
# rgb inputs here
76
- if not mpl . cbook . is_string_like (rgbin [0 ]):
84
+ if not isinstance (rgbin [0 ], _string_types ):
77
85
# normalize to be out of 1 if out of 256 instead
78
86
if rgbin .max () > 1 :
79
87
rgbin = rgbin / 256.
Original file line number Diff line number Diff line change @@ -363,6 +363,7 @@ cmocean available elsewhere!
363
363
* For `Paraview <https://github.com/kthyng/cmocean-paraview >`_, inspired by `Phillip Wolfram <https://github.com/pwolfram >`_.
364
364
* In `Plotly <https://plot.ly/python/cmocean-colorscales/ >`_
365
365
* Chad Greene's `Antartic Mapping Tools <http://www.mathworks.com/matlabcentral/fileexchange/47638-antarctic-mapping-tools >`_ in Matlab uses cmocean
366
+ * For `Tableau <https://www.tableau.com >`_ as a preferences file on `github <https://github.com/shaunwbell/cmocean_tableau >`_
366
367
.. * In PyNcView: coming soon!
367
368
368
369
Examples of beautiful visualizations:
You can’t perform that action at this time.
0 commit comments