Re: [Tutor] python and kiviat diagrams

2009-12-25 Thread Albert-Jan Roskam
Hi all,

Thanks for your insightful answers, and a merry Christmas + a happy new year!

Btw, somebody on the list mentioned rpy as an alternative way to create spider 
charts. I also think that's a better route to take. R is thoroughly tested and 
built for the job, and if you ever need more statistical/plotting things, you 
could easily extend your program.

Cheers!!

Albert-Jan



~~

In the face of ambiguity, refuse the temptation to guess.

~~

--- On Thu, 12/24/09, Kent Johnson ken...@tds.net wrote:

From: Kent Johnson ken...@tds.net
Subject: Re: [Tutor] python and kiviat diagrams
To: Albert-Jan Roskam fo...@yahoo.com
Cc: dwbarne dwba...@earthlink.net, python tutor tutor@python.org
Date: Thursday, December 24, 2009, 2:19 PM

On Wed, Dec 23, 2009 at 5:27 PM, Albert-Jan Roskam fo...@yahoo.com wrote:

 I was studying the code on 
 http://matplotlib.sourceforge.net/examples/api/radar_chart.html.
 Isn't it very unusual that a class is defined within a function?

Unusual, but not un-heard of. Usually the function is a factory
function that returns the class to the caller. In this case the class
is registered as the handler for projections of type 'radar'.
Presumably RadarAxes is implementing a protocol (interface) that is
required by register_projection().

 Why not use a class instance inside the function instead?

Presumably register_projection() requires a class (strictly speaking,
it probably requires a callable that returns an instance of a class
that implements the required protocol). There don't seem to be any
docs for register_projection() so it's hard to know for sure what it
wants.

 No methods of the class can currently be inherited outside the scope of the 
 function, right?

Do you mean, the class cannot be subclassed? Not easily, only because
the function doesn't return the class. There is no inherent reason
this class could not be subclassed if a reference to the class were
available.

Kent



  ___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] python and kiviat diagrams

2009-12-23 Thread Albert-Jan Roskam
I was studying the code on 
http://matplotlib.sourceforge.net/examples/api/radar_chart.html.
Isn't it very unusual that a class is defined within a function? Why not use a 
class instance inside the function instead? No methods of the class can 
currently be inherited outside the scope of the function, right?

Just curious..

Cheers!!

Albert-Jan



~~

In the face of ambiguity, refuse the temptation to guess.

~~

--- On Tue, 12/22/09, Kent Johnson ken...@tds.net wrote:

From: Kent Johnson ken...@tds.net
Subject: Re: [Tutor] python and kiviat diagrams
To: dwba...@earthlink.net
Cc: python tutor tutor@python.org
Date: Tuesday, December 22, 2009, 10:45 PM

On Tue, Dec 22, 2009 at 1:18 PM,  dwba...@earthlink.net wrote:
 One of the drawbacks of Matplotlib is that it does not have the capability of 
 drawing Kiviat diagrams.

 Does anyone know of a software package for drawing Kiviat diagrams written in 
 Python?

I don't know what a Kiviat diagram is but the images google shows me
look a lot like this:
http://matplotlib.sourceforge.net/examples/api/radar_chart.html

Kent
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor



  ___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] python and kiviat diagrams

2009-12-23 Thread Emile van Sebille

On 12/23/2009 2:27 PM Albert-Jan Roskam said...

I was studying the code on
http://matplotlib.sourceforge.net/examples/api/radar_chart.html.



Isn't it very unusual that a class is defined within a function?


Not when defining factory creation functions which a quick look at this 
code confirms that's what this says it's doing.  They're often used when 
creating compatibility layers to provide common named methods.



Why not use a class instance inside the function instead?


That's a question for the original developer.  You can get to the same 
place in many different ways, and the concept of 'There should be one-- 
and preferably only one --obvious way to do it.' no longer commands the 
same respect at this level of design.



No methods of the
class can currently be inherited outside the scope of the function, right?


Yes -- the class has served it's purpose once it's been registered.  It 
can of course be reached and could likely be invoked and could even 
possibly be used to create new instances, but you'd have to introspect 
and find the right __class__ attribute.  Both this level of 
introspection and factory methods are intermediate to advanced 
techniques that most of us will only rarely need, but it's good to know 
it can be done.


Emile

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] python and kiviat diagrams

2009-12-22 Thread Hilton Garcia Fernandes
Hello Daniel. 

There's a statistical package named R, from 
http://r-project.org 

that has pretty much everything related to statistics and data analysis. 
Kiviat diagrams, also known as star plots, or web plots etc., are among its 
abilities -- directly or using packages like 'rela' or 'homals', all 
available from the Comprehensive R Archive Network, or cran, at
http://cran.r-project.org/

Its many abilities can be easily used in Python through the rpy package, that 
is available from 
http://rpy.sourceforge.net/

All the best,
hilton 



On Tuesday 22 December 2009 16:18:56 dwba...@earthlink.net wrote:
 One of the drawbacks of Matplotlib is that it does not have the capability
 of drawing Kiviat diagrams.

 Does anyone know of a software package for drawing Kiviat diagrams written
 in Python?

 Daniel
 ___
 Tutor maillist  -  Tutor@python.org
 To unsubscribe or change subscription options:
 http://mail.python.org/mailman/listinfo/tutor



-- 
Hilton Garcia Fernandes
Nucleo de Tecnologias sem Fio (NTSF) -- Wireless Technologies Team
Lab de Sistemas Integraveis Tecnologico (LSI) -- Integrable Systems Lab
Escola Politecnica (Poli) -- Engineering School
Univ S Paulo (USP)
Tel: (5511)3091-5311 (work)
     (5511)8131-5213 (mobile)
Av. Prof. Luciano Gualberto,158 trav.3 CEP 05508-010
S. Paulo -- SP -- Brazil
Pagina inicial: http://www.lsi.usp.br/~hgfernan
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] python and kiviat diagrams

2009-12-22 Thread Kent Johnson
On Tue, Dec 22, 2009 at 1:18 PM,  dwba...@earthlink.net wrote:
 One of the drawbacks of Matplotlib is that it does not have the capability of 
 drawing Kiviat diagrams.

 Does anyone know of a software package for drawing Kiviat diagrams written in 
 Python?

I don't know what a Kiviat diagram is but the images google shows me
look a lot like this:
http://matplotlib.sourceforge.net/examples/api/radar_chart.html

Kent
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] python and kiviat diagrams

2009-12-22 Thread Hilton Garcia Fernandes
Congratulations ! 

It looks like matplotlib does the trick.

I became an rpy evangelist because this binding connect two very interesting,  
powerful and flexible things: R and Python.

Thanks, 
hilton 

On Tuesday 22 December 2009 19:45:18 Kent Johnson wrote:
 On Tue, Dec 22, 2009 at 1:18 PM,  dwba...@earthlink.net wrote:
  One of the drawbacks of Matplotlib is that it does not have the
  capability of drawing Kiviat diagrams.
 
  Does anyone know of a software package for drawing Kiviat diagrams
  written in Python?

 I don't know what a Kiviat diagram is but the images google shows me
 look a lot like this:
 http://matplotlib.sourceforge.net/examples/api/radar_chart.html

 Kent
 ___
 Tutor maillist  -  Tutor@python.org
 To unsubscribe or change subscription options:
 http://mail.python.org/mailman/listinfo/tutor



-- 
Hilton Garcia Fernandes
Nucleo de Tecnologias sem Fio (NTSF) -- Wireless Technologies Team
Lab de Sistemas Integraveis Tecnologico (LSI) -- Integrable Systems Lab
Escola Politecnica (Poli) -- Engineering School
Univ S Paulo (USP)
Tel: (5511)3091-5311 (work)
     (5511)8131-5213 (mobile)
Av. Prof. Luciano Gualberto,158 trav.3 CEP 05508-010
S. Paulo -- SP -- Brazil
Pagina inicial: http://www.lsi.usp.br/~hgfernan
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] python and kiviat diagrams

2009-12-22 Thread Hilton Garcia Fernandes
OK. 

But, please don't you forget to try R and rpy ! :) 

These guys do very clever tricks. 

On Tuesday 22 December 2009 20:39:35 dwba...@earthlink.net wrote:
 Kent and Hilton,

 I'm a victim of outdated documentation. Mine is v0.98 (no radar charts),
 while latest is v0.99. A small step in numbers, but a giant leap in
 capability!

 Thanks! Looks like Matplotlib will do the trick after all.

 Daniel


 -Original Message-

 From: Kent Johnson ken...@tds.net
 Sent: Dec 22, 2009 4:45 PM
 To: dwba...@earthlink.net
 Cc: python tutor tutor@python.org
 Subject: Re: [Tutor] python and kiviat diagrams
 
 On Tue, Dec 22, 2009 at 1:18 PM,  dwba...@earthlink.net wrote:
  One of the drawbacks of Matplotlib is that it does not have the
  capability of drawing Kiviat diagrams.
 
  Does anyone know of a software package for drawing Kiviat diagrams
  written in Python?
 
 I don't know what a Kiviat diagram is but the images google shows me
 look a lot like this:
 http://matplotlib.sourceforge.net/examples/api/radar_chart.html
 
 Kent



-- 
Hilton Garcia Fernandes
Nucleo de Tecnologias sem Fio (NTSF) -- Wireless Technologies Team
Lab de Sistemas Integraveis Tecnologico (LSI) -- Integrable Systems Lab
Escola Politecnica (Poli) -- Engineering School
Univ S Paulo (USP)
Tel: (5511)3091-5311 (work)
     (5511)8131-5213 (mobile)
Av. Prof. Luciano Gualberto,158 trav.3 CEP 05508-010
S. Paulo -- SP -- Brazil
Pagina inicial: http://www.lsi.usp.br/~hgfernan
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] python and kiviat diagrams

2009-12-22 Thread dwbarne
Kent and Hilton,

I'm a victim of outdated documentation. Mine is v0.98 (no radar charts), while 
latest is v0.99. A small step in numbers, but a giant leap in capability!

Thanks! Looks like Matplotlib will do the trick after all.

Daniel


-Original Message-
From: Kent Johnson ken...@tds.net
Sent: Dec 22, 2009 4:45 PM
To: dwba...@earthlink.net
Cc: python tutor tutor@python.org
Subject: Re: [Tutor] python and kiviat diagrams

On Tue, Dec 22, 2009 at 1:18 PM,  dwba...@earthlink.net wrote:
 One of the drawbacks of Matplotlib is that it does not have the capability 
 of drawing Kiviat diagrams.

 Does anyone know of a software package for drawing Kiviat diagrams written 
 in Python?

I don't know what a Kiviat diagram is but the images google shows me
look a lot like this:
http://matplotlib.sourceforge.net/examples/api/radar_chart.html

Kent

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor