---------- Forwarded message ----------
From: Christiaan Putter <[EMAIL PROTECTED]>
Date: 14 Mar 2008 03:22
Subject: Re: [Matplotlib-users] visualisation for utility usage sought
To: Chris Withers <[EMAIL PROTECTED]>

Hi there,

I'm having trouble understanding what it is you exactly want.

You said you want to indicate that 'the monthly usage between September 1st
and January 1st
was, on average, the same as that between January 1st and February 1st.'

So looking at the data you provided I'll assume the following:

The measurement your taking is not in fact the utility usage for one month,
but rather the sum of all usage over all prior months.  And unfortunately it
seems measurements aren't very regular (you working for the gov?).  :-) no
problem.

Seeing that we're missing some data for the months in between measurements
we'll have to interpolate.

The simplest will be linear line segments between the known data points.
(There are also some nice interpolation modules in scipy if you're looking
for something "smoother", ie. polynomials or cubic splines or something)

Linear interpolation should look something like this.

2007/09/01 - 5000
2007/10/01 - 5750
2007/11/01 - 6500
2007/12/01 - 7250
2008/01/01 - 8000
2008/02/01 - 9000


Of course we're looking for the usage per month so we'll just calculate the
difference in the aggregates.

2007/09/01 - 0
2007/10/01 - 750
2007/11/01 - 750
2007/12/01 - 750
2008/01/01 - 750
2008/02/01 - 1000

Obviously we don't have data prior to October so Augusts' usage ends up as
zero.  Now you can simply through that at matplotlib's plot() command and
Bob's you're uncle.  Using bar graphs for the usage per month is
recommended, seeing that the measurements are so inconsistent to begin with
plotting with continuous lines will only add to a false sense of accuracy.

I'll recommend not using linear interpolation on this because the data will
clearly be skewed.  In our case there would have been a gradual increase in
usage from September to January, and not the constant usage that linear
interpolation gave us.

Hope this helps.  With matplotlib and scipy you're basically covered for all
your scientific plotting needs.

Have a nice day now.
cputter




On 12/03/2008, Chris Withers <[EMAIL PROTECTED]> wrote:
>
> Hi All,
>
> I hope this isn't considered off topic here, but this has been bugging
> me for a while and I reckon you guys may be able to help. To boot, I'd
> like to use matplotlib to make it happen, so I figure this list is fair
> game ;-)
>
> So, I have a series of measurements at points in time, eg:
>
> 2007/09/01 - 5000
> 2008/01/01 - 8000
> 2008/02/01 - 9000
>
> ...and I'm looking to create some type of visualisation that indicates
> usage over time.
>
> The import point is that the gaps between point measurements are not
> constant, so a straight bar chart won't be right.
>
> The points also won't necessarilly be as convenient as those above, but
> hopefully they'll work as an example: What I'd expect to see would
> indicate that the monthly usage between September 1st and January 1st
> was, on average, the same as that between January 1st and February 1st.
>
> I'm having trouble expressing myself clearly, but hopefully I'm making
> some kind of sense.
>
> Any ideas very greatfully recieved!
>
> cheers,
>
> Chris
>
> --
> Simplistix - Content Management, Zope & Python Consulting
>             - http://www.simplistix.co.uk
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to