Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Change in handling of scatter c= argument with shape (1, 4) #17431

Closed
@mwaskom

Description

@mwaskom

Bug report

Bug summary

In 3.2,scatter is color-mapping 4 points when thec input is 2D with shape (1, 4). This is a change from 3.1.

The docs forscatter say

Note thatc should not be a single numeric RGB or RGBA sequence
because that is indistinguishable from an array of values to be
colormapped. If you want to specify the same RGB or RGBA value for
all points, use a 2-D array with a single row. Otherwise, value-
matching will have precedence in case of a size matching withx
andy.

However, this is no longer true.

I suspect#17245 may be related (only based on milestone and description, I haven't debugged the code).

Code for reproduction

importmatplotlib.pyplotaspltx=y=1,2,3,4c= [(.2,.5,.8,1)]f,ax=plt.subplots()ax.scatter(x,y,c=c,s=100)# Increase s for visibility

Actual outcome

On 3.2.1

image

Expected outcome

On 3.1.2:

image

Matplotlib version

  • Operating system: macos
  • Matplotlib version: 3.2.1
  • Matplotlib backend (print(matplotlib.get_backend())): pylab inline
  • Python version: na
  • Jupyter version (if applicable): na
  • Other libraries: na

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp