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

[Bug]: Setting norm by string doesn't work for hexbin #28105

Closed
Milestone
@anntzer

Description

@anntzer

Bug summary

In#20752 I added support forimshow(..., norm="log"), and documented that the feature is supported in particular by hexbin as well; but this doesn't actually work for hexbin, because hexbin tries to run stuff on the norm before normalizing strings.

Code for reproduction

frompylabimport*hexbin(rand(100),rand(100),norm="log")

Actual outcome

  File ".../matplotlib/axes/_axes.py", line 5247, in hexbin    if norm.vmin is None and norm.vmax is None:       ^^^^^^^^^AttributeError: 'str' object has no attribute 'vmin'

Expected outcome

no error

Additional information

Probably the block

# autoscale the norm with current accum values if it hasn't been setifnormisnotNone:ifnorm.vminisNoneandnorm.vmaxisNone:norm.autoscale(accum)

can just be moved down a bit after collection.set_norm(norm) (then we can get back the canonicalized norm from the collection). I haven't looked at how this interacts with the call to _scale_norm just below, though.

Operating system

any

Matplotlib Version

3.9.0.dev1523+g2723052176

Matplotlib Backend

any

Python version

3.12

Jupyter version

no

Installation

None

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp