Bar graphs showing up incorrectly until they are resized:

Hi,

I am using matplotlib to draw a few bar plots. The library works wonderfully, but the figures are drawn incorrectly until they are resized

Here is the figure before resizing:

http://imgur.com/MKATg

here is after resizing:

http://imgur.com/bSiOT

It seems that the rectangles of the bar somehow are not drawn properly.

Any suggestions on how to fix it automatically?

Federico

Federico,

Could you please be a bit more specific about what you think is wrong. I see a number of possibilities, but I can’t be sure what you are referring to.

Ben Root

···

On Thu, Feb 23, 2012 at 5:02 AM, federico vaggi <vaggi.federico@…287…> wrote:

Hi,

I am using matplotlib to draw a few bar plots. The library works wonderfully, but the figures are drawn incorrectly until they are resized

Here is the figure before resizing:

http://imgur.com/MKATg

here is after resizing:

http://imgur.com/bSiOT

It seems that the rectangles of the bar somehow are not drawn properly.

Any suggestions on how to fix it automatically?

Federico

Hi Ben,

In the pre-resizing pictures, each bar is drawn as two rectangles, the first until the lower margin of the standard deviation, the second until the mean.

It looks like it draws one rectangle from:

0:(MEAN-STD)

and another from:

MEAN-STD to MEAN+STD

After resizing, it is just a single rectangle with the standard deviation drawn as normal.

I presume the 2nd version is meant to be correct, but absolutely no graphics properties are altered (besides manually re-sizing the window).

Federico

···

On Thu, Feb 23, 2012 at 4:54 PM, Benjamin Root <ben.root@…1304…> wrote:

On Thu, Feb 23, 2012 at 5:02 AM, federico vaggi <vaggi.federico@…287…> wrote:

Hi,

I am using matplotlib to draw a few bar plots. The library works wonderfully, but the figures are drawn incorrectly until they are resized

Here is the figure before resizing:

http://imgur.com/MKATg

here is after resizing:

http://imgur.com/bSiOT

It seems that the rectangles of the bar somehow are not drawn properly.

Any suggestions on how to fix it automatically?

Federico

Federico,

Could you please be a bit more specific about what you think is wrong. I see a number of possibilities, but I can’t be sure what you are referring to.

Ben Root

Sorry, I am not seeing what you are saying. Just to be clear, when you say “bar”, are you referring to the gray rectangles that denote the mean or the errorbars that denote the standard deviations?

What might be confusing is that in the first graph, the “cap” of the errorbars (the horizontal line on the ends of each errorbar) is almost the same width as the gray bars themselves. This sort of makes it look like there are two gray bars stacked on top of each other. Is this what you are referring to?

Ben Root

···

On Thu, Feb 23, 2012 at 10:03 AM, federico vaggi <vaggi.federico@…287…> wrote:

Hi Ben,

In the pre-resizing pictures, each bar is drawn as two rectangles, the first until the lower margin of the standard deviation, the second until the mean.

It looks like it draws one rectangle from:

0:(MEAN-STD)

and another from:

MEAN-STD to MEAN+STD

After resizing, it is just a single rectangle with the standard deviation drawn as normal.

I presume the 2nd version is meant to be correct, but absolutely no graphics properties are altered (besides manually re-sizing the window).

Federico

I think you are correct - and I think the fact that the line width of the error bar is larger (compared to the size of the rectangle) gives the impression the top rectangle is actually darker.

I see - it’s just a matter of playing around with the error bar properties to make it look pretty.

Thanks,

Federico

···

On Thu, Feb 23, 2012 at 5:13 PM, Benjamin Root <ben.root@…1304…> wrote:

On Thu, Feb 23, 2012 at 10:03 AM, federico vaggi <vaggi.federico@…287…> wrote:

Hi Ben,

In the pre-resizing pictures, each bar is drawn as two rectangles, the first until the lower margin of the standard deviation, the second until the mean.

It looks like it draws one rectangle from:

0:(MEAN-STD)

and another from:

MEAN-STD to MEAN+STD

After resizing, it is just a single rectangle with the standard deviation drawn as normal.

I presume the 2nd version is meant to be correct, but absolutely no graphics properties are altered (besides manually re-sizing the window).

Federico

Sorry, I am not seeing what you are saying. Just to be clear, when you say “bar”, are you referring to the gray rectangles that denote the mean or the errorbars that denote the standard deviations?

What might be confusing is that in the first graph, the “cap” of the errorbars (the horizontal line on the ends of each errorbar) is almost the same width as the gray bars themselves. This sort of makes it look like there are two gray bars stacked on top of each other. Is this what you are referring to?

Ben Root