Very simple question, but I can't still find a solution.

Hi all,
i just want to have a simple bar-chart,
and my problem is that i want it to be with NON-squared aspect, i.e. the x-axis to be as long as i need with 2 little bart.
Instead i get a squared graph with 2 big bars even if i change width value.

This is my source:

import numpy as np
import matplotlib
import matplotlib.pyplot as plt

N = 1
ind = np.arange(N)
width = 0.05

rects2 =, 100, width, color=‘g’)
rects1 =, 200, width, color=‘b’)

I tried many things, figsize, axis… i have no idea,
probably because i’m new to matplotlib programming/

Thank you very much for any help,
my best


Hi Dante,
  If I've understood you correctly, then you need to add one line:

# Set the limits of the x-axis, overriding default.
plt.xlim(0, 4)

Hope this helps,



View this message in context:'t-still-find-a-solution.-tp22152593p22179003.html
Sent from the matplotlib - users mailing list archive at