Skip to content

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

Closed

Description

@KeithWM

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

Activity

  1. added this to the milestone on Jan 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions