Column graph with variable width

I managed to generated the chart I want by twisting the hist() function. I chart and source code can be found here:

If you have any comment on my method it will be greatly appriciated.

Wai Yip


I want to plat a column graph with variable width. The size of both axis
have meaning. The Y-axis is the density. The X-axis is the size. Let's say
it is a graph of world population by country. Say China has 1 billion
people occupying an area of 10000 km2. And Japan has 0.1 billion people
occupying an area 500 km2. So their density is 1 billion / 10000 and 0.1
billion / 500 respectively. The chart should show Japan's column twice as
high as China but much narrower. And the area of each column reflects the

My question is how do I plot a column graph with variable width? The
closest I can find is in the histogram in the second example below

I'm quite new to matplotlib. Thanks for your help.

Wai Yip

Download Intel® 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.

Using Opera's revolutionary e-mail client: