We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e7438b5 commit 6976632Copy full SHA for 6976632
1 file changed
src/tikzplotlib/_axes.py
@@ -784,9 +784,13 @@ def _handle_listed_color_map(cmap, data):
784
# 'winter': 'winter',
785
}
786
for mpl_cm, pgf_cm in cm_translate.items():
787
- if cmap.colors == plt.get_cmap(mpl_cm).colors:
788
- is_custom_colormap = False
789
- return (pgf_cm, is_custom_colormap)
+ try:
+ if cmap.colors == plt.get_cmap(mpl_cm).colors:
+ is_custom_colormap = False
790
+ return (pgf_cm, is_custom_colormap)
791
+ except ValueError:
792
+ # 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
793
+ pass
794
795
unit = "pt"
796
ff = data["float format"]
0 commit comments