Skip to content

If hexbin has logarithmic bins, use log formatter for colorbar #7842

Closed
@dstansby

Description

@dstansby

hexbin allows bins='log', which sets the color scale for the bins to be logarithmic. Adding a colorbar results in a normally scaled colorbar (which I assume is log(points in each bin)?). It would be nice if this could be log formatted instead. Present on master.

import matplotlib.pyplot as plt
import numpy as np

x = np.random.rand(1000)
y = np.random.rand(1000)

plt.hexbin(x, y, bins='log', mincnt=1)
plt.colorbar()
plt.show()

figure_1-3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions