Skip to content

Passing a transposed array to patch.set_offsets() #7785

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

Closed
KeithWM opened this issue Jan 10, 2017 · 0 comments · Fixed by #7786
Closed

Passing a transposed array to patch.set_offsets() #7785

KeithWM opened this issue Jan 10, 2017 · 0 comments · Fixed by #7786
Milestone

Comments

@KeithWM
Copy link

KeithWM commented Jan 10, 2017

To help us understand and resolve your issue please check that you have provided
the information that corresponds to the type of issue that you are submitting. You can feel free to delete the sections that do not apply to your issue.

###Bug report

Bug summary
The method patch.set_offsets() fails quietly if passed a transposed array compared to what it expects.

Code for reproduction

import scipy
from matplotlib import pyplot as plt

U = scipy.rand(2,10)
patch = plt.scatter(U[0, :], U[1, :])
U[0, :] = 0
patch.set_offsets(U)
plt.show()

Actual outcome

A figure with 5 scattered points at the origin and 5 scattered in the box [0,1]x[0,1]

Expected outcome

I expect this to fail, the array U should be Nx2, rather than 2xN

Matplotlib version

Python 2.7.11 |Anaconda 2.4.1 (x86_64)| (default, Dec 6 2015, 18:57:58) (MacOSX)
Matplotlib version: 1.5.1

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 a pull request may close this issue.

2 participants