I have question about histogram

i want 2016-2017data not show.

so i did below

filtered_df = df[~df[‘Year’].isin([2016, 2017])]
filtered_df[‘Year’][filtered_df[‘Year’]== 2016]

fig = px.histogram(filtered_df, x=‘Year’, color=“규모별”,
fig.update_layout(width=800, height=600)

but there is a hole. i want there are no hole
can you help me???

That is because you are using a time x-axis. Try changing to category.

See also here:

Thank you. I fixed it with go.

but i have question about xaxis in px.
in px.histogram, i can’t fix this.


i can’t find xaxis categorical…
in px.histogram, can i fix it??

This should work:

fig.update_xaxes({'type': 'category'})

px uses go under the hood.