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

Open
KeithWM opened this Issue Jan 10, 2017 · 0 comments

Projects

None yet

2 participants

@KeithWM
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

@tacaswell tacaswell added this to the 2.1 (next point release) milestone Jan 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment