Skip to content

Commit 478a704

Browse files
authored
Merge pull request #1 from matplotlib/master
pulling in changes to my local version
2 parents 8196cfd + 64bc250 commit 478a704

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

cmocean/tools.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,18 @@
22
Plot up stuff with colormaps.
33
'''
44

5+
import sys
6+
57
import numpy as np
68
import matplotlib as mpl
79

810

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+
917
def print_colormaps(cmaps, N=256, returnrgb=True, savefiles=False):
1018
'''Print colormaps in 256 RGB colors to text files.
1119
@@ -73,7 +81,7 @@ def cmap(rgbin, N=256):
7381
'''
7482

7583
# rgb inputs here
76-
if not mpl.cbook.is_string_like(rgbin[0]):
84+
if not isinstance(rgbin[0], _string_types):
7785
# normalize to be out of 1 if out of 256 instead
7886
if rgbin.max() > 1:
7987
rgbin = rgbin/256.

docs/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ cmocean available elsewhere!
363363
* For `Paraview <https://github.com/kthyng/cmocean-paraview>`_, inspired by `Phillip Wolfram <https://github.com/pwolfram>`_.
364364
* In `Plotly <https://plot.ly/python/cmocean-colorscales/>`_
365365
* 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>`_
366367
.. * In PyNcView: coming soon!
367368
368369
Examples of beautiful visualizations:

0 commit comments

Comments
 (0)