cumulative percentage

Hi:

I did had a look before, but I couldn’t find a good example

I was hoping to get an example from the list

I.

···

From: John Hunter <jdh2358@…287…>
To: sandric ionut <sandricionut@…9…>
Cc: matplotlib-users@lists.sourceforge.net
Sent: Saturday, November 1, 2008 10:12:29 PM
Subject: Re: [Matplotlib-users] cumulative percentage

On Sat, Nov 1, 2008 at 2:53 PM, sandric ionut <sandricionut@…9…> wrote:

How can I plot cumulative percentage with matplotlib?

Please, can someone give me an example?

Take a look at the “extended” histogram examples at

http://matplotlib.sourceforge.net/examples/pylab_examples/histogram_demo_extended.html

You can also search the docs for histogram:

http://matplotlib.sourceforge.net/search.html?q=histogram

JDH

The example is in the link I posted

http://matplotlib.sourceforge.net/examples/pylab_examples/histogram_demo_extended.html

but I will include it here for your convenience

  n, bins, patches = P.hist(x, 50, normed=1, histtype='step', cumulative=True)

  # add a line showing the expected distribution
  y = P.normpdf( bins, mu, sigma).cumsum()
  y /= y[-1]
  l = P.plot(bins, y, 'k--', linewidth=1.5)

See the link for the full example code

JDH

···

On Sat, Nov 1, 2008 at 3:35 PM, sandric ionut <sandricionut@...9...> wrote:

Hi:

I did had a look before, but I couldn't find a good example
I was hoping to get an example from the list