Skip to content

Commit

Permalink
Merge pull request #2485 from NelleV/error_message
Browse files Browse the repository at this point in the history
ENH better error message when wrong cmap name.
  • Loading branch information
pelson committed Oct 10, 2013
2 parents 26498aa + 1129d9c commit 65ce30e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/matplotlib/cm.py
Expand Up @@ -157,8 +157,10 @@ def get_cmap(name=None, lut=None):
return cmap_d[name]
elif name in datad:
return _generate_cmap(name, lut)

raise ValueError("Colormap %s is not recognized" % name)
else:
raise ValueError(
"Colormap %s is not recognized. Possible values are: %s"
% (name, ', '.join(cmap_d.keys())))


class ScalarMappable:
Expand Down

0 comments on commit 65ce30e

Please sign in to comment.