Skip to content

Cannot access hexbin data when xscale='log' and yscale='log' are set. #18045

Closed

Description

@mankoff

Bug report

plt.hexbin([1,10,100],[1,10,100], mincnt=1).get_offsets()
plt.hexbin([1,10,100],[1,10,100], mincnt=1, xscale='log', yscale='log').get_offsets()

I've made a log-log hexbin plot and would like to access the points generated by hexbin so I can make a contour. I cannot access these points for two reasons:

  1. The documentation is incorrect and states that PolyCollection.get_offset() should be called, but it is PolyCollection.get_offsets() (note plural). See 1st bullet point under returns here https://matplotlib.org/3.3.0/api/_as_gen/matplotlib.pyplot.hexbin.html

  2. When I call get_offsets() if xscale='log' and yscale='log' are set, I only get array([[0., 0.]]) rather than the points.

Activity

  1. rgmumufeng commented on May 17, 2022

    @rgmumufeng

    It seems that the "no hexbin data for log scale" issue still exists. Is there any update for this issue?

  2. github-actions commented on Aug 14, 2023

    @github-actions

    This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

  3. mankoff commented on Aug 14, 2023

    @mankoff
    Author

    Still open. Would still like to use this feature with log log plots.

  4. dstansby commented on Feb 24, 2024

    @dstansby
    Member

    The first half of the issue (documentation) is fixed. I can confirm the second half is still an issue though.

  5. added this to the v3.10.0 milestone on Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions