# Thinner bar charts

**URL:** <https://community.plotly.com/t/thinner-bar-charts/79387>\
**Category:** 📊 Plotly Python\
**Created:** [October 17, 2023, 12:11pm UTC](https://community.plotly.com/t/thinner-bar-charts/79387 "2023-10-17T12:11:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anne12](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@anne12](https://community.plotly.com/u/anne12)\
**Post date:** [October 17, 2023, 12:11pm UTC](https://community.plotly.com/t/thinner-bar-charts/79387/1 "2023-10-17T12:11:46Z")

</div>

Hi,  
How can I make this bar charts thinner?

 ![image](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/c/5/c5a054091ffb2d8f30f7d3cc6d5ba024df7a26b0.png)

I have used this code:

```python
import numpy as np
import pandas as pd
import plotly.express as px
from plotly.graph_objs import Bar, Scatter, Marker, Layout 
from IPython.display import display
import plotly.graph_objs as go
df = pd.read_excel(r'C:\Users\amhd\Documents\test1.xlsx')

fig = go.Figure()

fig.add_trace(go.Bar(name='test', x=df['time'], y=df['number'], marker_color='#003E69'))

fig.update_layout(barmode='group', template='plotly_white', legend=dict(orientation='h', x=0.9),
                  title={
                      'text': "test",
                      'y':1,
                      'x':0.5,
                      'xanchor': 'center',
                      'yanchor': 'top'})
fig.update_xaxes(type='category')

fig.show()

```

---

<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:** [October 17, 2023, 2:06pm UTC](https://community.plotly.com/t/thinner-bar-charts/79387/2 "2023-10-17T14:06:26Z")

</div>

Hi, please have a read here:

> **[Bar](https://plotly.com/python/bar-charts/)**
>
> Over 32 examples of Bar Charts including changing color, size, log axes, and more in Python.

```auto
Customizing Individual Bar Widths

```
