Thanks to visit codestin.com
Credit goes to github.com

Skip to content

hist2d with log xy axis #4615

Closed
Closed
@jankoeh

Description

@jankoeh

I often create 2d histograms with log x or y axis.
The hist2d function uses the pcolorfast method which can not handle log xy axes.

The following code explains this issue:

from pylab import *
axis = logspace(-1,0, 10)
hist2d(rand(100), rand(100), bins=(axis,axis)) #this still looks as it is supposed to look
xscale('log') #this scales only the ticks, but not the histogram

This could be fixed by using pcolormesh instead of pcolorfast in axis.py.
If there is no specific reason for using pcolorfast instead of pcolormesh I would propose to change this.

I'd be happy to create a fork and submit a pull request (it's only one line ...).

Thanks!

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