Open jasongrout opened 8 years ago
Currently, at https://github.com/sagemath/sage-prod/blob/1b1e6f608d1ef8ee664bb19e991efbbc68cbd51f/src/sage/plot/colors.py#L1393, we manually check colormap names against matplotlib's cmap.datad dictionary. The new viridis map is not in there, though. Instead, we should just use matplotlib.cm.get_cmap, and possibly catch the error (or let the error fall through) if there is no cmap with that name.
Example code that should work:
density_plot(x^2-y^2,(x,-2,2),(y,-2,2),cmap='viridis', aspect_ratio=1).show()
Current workaround - get the cmap ourselves:
import matplotlib density_plot(x^2-y^2,(x,-2,2),(y,-2,2),cmap=matplotlib.cm.get_cmap('viridis'), aspect_ratio=1).show()
Component: graphics
Issue created by migration from https://trac.sagemath.org/ticket/21954
https://github.com/sagemath/sage-prod/blob/1b1e6f608d1ef8ee664bb19e991efbbc68cbd51f/src/sage/plot/colors.py#L1442 should perhaps use cmap_d instead of datad as well.
cmap_d
datad
Currently, at https://github.com/sagemath/sage-prod/blob/1b1e6f608d1ef8ee664bb19e991efbbc68cbd51f/src/sage/plot/colors.py#L1393, we manually check colormap names against matplotlib's cmap.datad dictionary. The new viridis map is not in there, though. Instead, we should just use matplotlib.cm.get_cmap, and possibly catch the error (or let the error fall through) if there is no cmap with that name.
Example code that should work:
Current workaround - get the cmap ourselves:
Component: graphics
Issue created by migration from https://trac.sagemath.org/ticket/21954