Skip to content

catching error during messy RGBA colour handling #221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 31, 2018
Merged

catching error during messy RGBA colour handling #221

merged 4 commits into from
Jan 31, 2018

Conversation

tino-michael
Copy link

When using matplotlib colours like "darkorange" or "darkred"

https://github.com/nschloe/matplotlib2tikz/blob/66da89dcd5c6b3eff14602ae28e14bc10075ff00/matplotlib2tikz/legend.py#L206

creates nested RGBA codes like

[[ 0.54509804  0.          0.          1.        ]]
[[ 1.          0.54901961  0.          1.        ]]

and matplotlib will throw an error.

With this PR, the error gets caught and the function call repeated with a numpy.squeeze applied to the colour.

@nschloe nschloe merged commit 1cf66a0 into nschloe:master Jan 31, 2018
@tino-michael tino-michael deleted the dark_colour branch January 31, 2018 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants