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.08k stars 105 forks source link

Bar Chart x axis labels not formatted #1282

Open daxsoule opened 7 months ago

daxsoule commented 7 months ago

I am trying to make a bar plot of Earthquakes per day Earthquake Plot

How do I control the dates listed on the x axis?

df.hvplot.bar(y = count, title = 'Earthquakes per Day', ylabel = 'Count', xlabel = 'Date')

Stack traceback and/or browser JavaScript console output

Screenshots or screencasts of the bug in action

ahuang11 commented 6 months ago

Maybe error bars as a workaround?

import pandas as pd
import hvplot.pandas

# Create a DataFrame with datetime index
data = {"Values": range(100)}
index = pd.date_range("2022-01-01", periods=100, freq="D")
df = pd.DataFrame(data, index=index)
df["Zero"] = 0

# Create a bar chart
errorbars = df.hvplot.errorbars(y="Values", yerr1="Values", yerr2="Zero")

errorbars
image
jbednar commented 6 months ago

xrotation=90?

philippjfr commented 6 months ago

Okay, finally sat down and made a start on continuous bar charts: https://github.com/holoviz/holoviews/pull/6145