# Plotly rounding years to decade in bar chart

**URL:** <https://community.plotly.com/t/plotly-rounding-years-to-decade-in-bar-chart/92454>\
**Category:** 📊 Plotly Python\
**Tags:** question\
**Created:** [May 26, 2025, 11:29pm UTC](https://community.plotly.com/t/plotly-rounding-years-to-decade-in-bar-chart/92454 "2025-05-26T23:29:14Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![AIMPED](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/aimped/32/21758_2.png) [@AIMPED](https://community.plotly.com/u/AIMPED)\
**Post date:** [May 27, 2025, 9:19am UTC](https://community.plotly.com/t/plotly-rounding-years-to-decade-in-bar-chart/92454/3 "2025-05-27T09:19:17Z")

</div>

What you see are actually not rounded values but the default ticks. If you need specific ticks you might take a look at this:

> [@Use YYYY-MM as X-axis](https://community.plotly.com/t/use-yyyy-mm-as-x-axis/70493):
>
> How can i adjust the x-axis ? My code import plotly.offline as pyo import plotly.graph\_objs as go import pandas as pd import datetime as dt data = {‘date’:[‘2022-01’, ‘2022-02’, ‘2022-03’, ‘2022-04’], ‘val1’:[20, 21, 19, 18], ‘val2’:[2, 51, 16, 18]} df = pd.DataFrame(data) trace1 = go.Bar( x=df[‘date’], # NOC stands for National Olympic Committee y=df[‘val1’], ) trace2 = go.Bar( x=df[‘date’], y=df[‘val2’], ) data = [trace1, trace2] layout = go.Layout( title=‘some title’, bar…

---

_[View the full topic](https://community.plotly.com/t/plotly-rounding-years-to-decade-in-bar-chart/92454)._
