We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8a38582 commit c6b065cCopy full SHA for c6b065c
matplotlib2tikz/legend.py
@@ -202,6 +202,10 @@ def draw_legend(data, obj):
202
# Set color of lines in legend
203
for handle in obj.legendHandles:
204
try:
205
+ # when using matplotlib colours like "darkred" or "darkorange",
206
+ # `handle.get_color` will create nested RGBA codes
207
+ # e.g. `[[ 0.54509804, 0., 0., 1.]]` which casuse mpl to throw an error.
208
+ # catch this error, `numpy.squeeze` the colour code and try again
209
210
data, legend_color, _ = mycol.mpl_color2xcolor(
211
data, handle.get_color())
0 commit comments