We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4e62e16 commit 5cd8403Copy full SHA for 5cd8403
src/tikzplotlib/_axes.py
@@ -789,9 +789,13 @@ def _handle_listed_color_map(cmap, data):
789
# 'winter': 'winter',
790
}
791
for mpl_cm, pgf_cm in cm_translate.items():
792
- if cmap.colors == plt.get_cmap(mpl_cm).colors:
793
- is_custom_colormap = False
794
- return (pgf_cm, is_custom_colormap)
+ try:
+ if cmap.colors == plt.get_cmap(mpl_cm).colors:
+ is_custom_colormap = False
795
+ return (pgf_cm, is_custom_colormap)
796
+ except ValueError:
797
+ # might happen if cmap.colors cannot be broadcast against plt.get_cmap(mpl_cm).colors as an np array, in which case they are definitely not equal
798
+ pass
799
800
unit = "pt"
801
ff = data["float format"]
0 commit comments