Hi Lee,

That was it. It took me a few more minutes to find out that set_xlim
and set_ylim are methods in of the figure but now it's working nicely.
I also found that the set_[xy]lim methods have to be called after the
bar() method.

Updated script:
/----------------------------------------
from pylab import *
import sys
fig = figure()
ax = fig.add_subplot(111)
if(len(sys.argv) > 1 and sys.argv[1].lower() == 'y'):
    ax.bar([1, 2, 3, 4, 5], [0, 1, 0, 0, 0])
else:
    ax.bar([1, 2, 3, 4, 5], [1, 2, 3, 4, 5])
ax.set_xlim(0, 6)
show()
\----------------------------------------

The output is at http://img149.imageshack.us/img149/9302/updatedf.png .

Thanks a lot.



On Fri, Mar 26, 2010 at 3:12 PM, Jae-Joon Lee <lee.j.j...@gmail.com> wrote:
> I think it is just that the x-range is wrongly set.
> Try something like
>
> xlim(1, 6)
> ylim(-1, 2)
>
> You will see zero-height rectangles.
>
> Currently, zero-height rectangles are ignored for autoscaling x- and y-axis.
> Regards,

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to