holoviz / hvplot

A high-level plotting API for pandas, dask, xarray, and networkx built on HoloViews
https://hvplot.holoviz.org
BSD 3-Clause "New" or "Revised" License
1.06k stars 103 forks source link

`hist` with `logx` produces buckets in non-logarithmic scale #1313

Open david-cortes opened 4 months ago

david-cortes commented 4 months ago

If creating a histogram with logx=True, the buckets will be created in the original scale instead of the logarithmic scale:

import numpy as np, polars as pl
import hvplot.polars
rng = np.random.default_rng(seed=123)
df = pl.DataFrame({
    "x": 10. ** rng.standard_normal(size=100)
})
df.hvplot.hist(logx=True)

image

This should produce buckets like these, but with the x-axis labels and ticks reflecting the original scale:

(
    df
    .with_columns(
        pl.col("x").log10()
    )
    .hvplot.hist()
)

image

ahuang11 commented 4 months ago

I believe this is an HoloViews issue.

Potentially related to: https://github.com/holoviz/holoviews/pull/6145