Re: [Matplotlib-users] x-axis line in bar plots

2009-02-02 Thread Ramashish Baranwal
>> x = range(10) >> y = [random.randint(-10, 10) for i in x] >> bar(x, y) >> >> What I want is a line to be drawn at y=0. Any idea how to get it done? > > How about axhline: > > axhline(color='k', lw=1) > > See the documentation of axhline (and hlines) for more. Thanks Jouni! This is exactly what

[Matplotlib-users] x-axis line in bar plots

2009-02-02 Thread Ramashish Baranwal
Hi, I am creating a bar graph which contains negative values on y-axis. Everything is fine, but there is no line corresponding to y=0, so the bars seem a bit weird. Here is a short example- x = range(10) y = [random.randint(-10, 10) for i in x] bar(x, y) What I want is a line to be drawn at y=0.