One way to do this is by using xlim()
. As you have categorical x-axis, it is set at 0. So, you can use limit of -1 and 1 to make it thinner. The more the difference, thinner the bar...
x = ['Category']
y = [10]
fig, ax = plt.subplots(figsize=(4, 4))
bar_width = 0.3
ax.bar(x, y, width=bar_width)
ax.set_xlim(-1, 1)
plt.show()

Another way to change the perspective of the bar width, relative to the x-axis, is to increase the x-axis margins with ax.margins(x=1)
Given x = ['Category']
, ax.get_xticklabels()
results in [Text(0, 0, 'Category')]
.
Given x = [0]
, ax.get_xticklabels()
results in
[Text(-0.2, 0, '−0.20'),
Text(-0.15000000000000002, 0, '−0.15'),
Text(-0.1, 0, '−0.10'),
Text(-0.04999999999999999, 0, '−0.05'),
Text(0.0, 0, '0.00'),
Text(0.04999999999999999, 0, '0.05'),
Text(0.10000000000000003, 0, '0.10'),
Text(0.15000000000000002, 0, '0.15'),
Text(0.2, 0, '0.20')]
Which does a better job of showing the width of the bar in relation to the range of the x-axis ticks. The bar is the same width, but the range of the x-axis is larger.
