Thanks Fred.

Thant did the trick. However now, when I have many plots on x axis,

the last few plot shoot of the end of the x axis. It seems to start

the plotting the middle move to the right. Do I just have to adjust

the xlim on the axes[0]? I fiddled with the "align" parameter, set it

to "center", on the bar function and it didn't do much.

-Alen

## ···

On 8/24/07, Fred Ludlow <rfl26@...776...> wrote:

> Alen Ribic wrote:

> > How do I set my vertical bar to be fixed width?

>

> By default, bars are created with a fixed width of 0.8, which can be

> changed with the width keyword arg like so:

>

> bar(range(2), range(1,3), width = 0.5)

>

>

> > Depending on amount of data on my x axis, the bars get created

> > accordingly and the width gets adjusted to fit into the graph.

> The width in pixels/proportion of axis is dependent on the range of the

> x-axis, which you can set manually too.

>

> There's probably a more elegant way of doing this, but here's a quick

> and dirty method for interactive mode (ipython/pylab):

>

> # Make a figure, catch the reference as f

> f = figure(1)

>

> # Draw some bars

> bar_list = bar(array([0,0.5,1.0]), array([1.0,2.0,3.0]), width = 0.25)

>

> # Get the subplot (f.axes is a list containing the subplots)

> s = f.axes[0]

>

> # Set the x-axis limits of the subplot

> s.set_xlim((-5.0, 5.0))

>

> # Redraw

> draw()

>

>

> Fred

>

> -------------------------------------------------------------------------

> This SF.net email is sponsored by: Splunk Inc.

> Still grepping through log files to find problems? Stop.

> Now Search log events and configuration files using AJAX and a browser.

> Download your FREE copy of Splunk now >> http://get.splunk.com/

> _______________________________________________

> Matplotlib-users mailing list

> Matplotlib-users@lists.sourceforge.net

> matplotlib-users List Signup and Options

>