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
Imshow does not copy data array but determines colormap values upon call #6419
Comments
Data should be copied. |
I can make a PR for that today. |
If you throw a |
To prevent the problem illustrated here, it is essential to copy |
Closed by #6422 |
The following code produces a horizontal gradient plot instead of a horizontal line:
Please note that if we comment
Z[50]=100
the issue is not apparent as an all white figure is created as expected, but e.g. in Qt4Agg backend, mouseover values shows the altered Z values.This means that imshow does not copy the data array but sets the color scale at the
ax.imshow()
call.If data is intentionally not copied, I'd suggest adding a big warning about this behavior in the documentation and then the colorscale determination should be deferred until the figure is actually drawn. Otherwise the data should be copied.
The text was updated successfully, but these errors were encountered: