spie charts in matplotlib?

I am interested in making spie charts in matplotlib, as discussed
http://www.nabble.com/forum/NewTopic.jtp?forum=2906 here and
http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=106 available
in R . Additionally, I would like to have a grid of such charts within a
single graphic frame, something along the lines of the
http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=63 star chart
demo in the R gallery, but with spie charts instead of star charts.

I have looked at the pie source code in site-packages/matplotlib/axes.py and
have an idea of what I need to do. Just wondering if anyone has attempted
this and has any tips? If I can get the functionality working well I'll work
on contributing the example to the matplotlib gallery.

Thanks!

Josh

···


View this message in context: http://www.nabble.com/spie-charts-in-matplotlib--tp22856064p22856064.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Is this what you are looking for:

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

JDH

···

On Thu, Apr 2, 2009 at 3:11 PM, totallyunimodular <jhemann@...1899...> wrote:

I am interested in making spie charts in matplotlib, as discussed
http://www.nabble.com/forum/NewTopic.jtp?forum=2906 here and
http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=106 available
in R . Additionally, I would like to have a grid of such charts within a
single graphic frame, something along the lines of the
http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=63 star chart
demo in the R gallery, but with spie charts instead of star charts.

Wow, it is really striking how much better the matplotlib version of
this plot is compared to R. Very nice!

Brian

···

On Thu, Apr 2, 2009 at 7:21 PM, John Hunter <jdh2358@...287...> wrote:

On Thu, Apr 2, 2009 at 3:11 PM, totallyunimodular <jhemann@...1899...> wrote:

I am interested in making spie charts in matplotlib, as discussed
http://www.nabble.com/forum/NewTopic.jtp?forum=2906 here and
http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=106 available
in R . Additionally, I would like to have a grid of such charts within a
single graphic frame, something along the lines of the
http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=63 star chart
demo in the R gallery, but with spie charts instead of star charts.

Is this what you are looking for:

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

JDH

------------------------------------------------------------------------------
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

Sorry forgot to answer your second question. You can create multiple
columns and rows of subplots using the subplot command. Here is an
example:

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

and here is the subplot tutorial

  http://matplotlib.sourceforge.net/users/pyplot_tutorial.html#working-with-multiple-figures-and-axes

When working with lots-o-subplots, you may want to adjust the spacing
between them as well as around the edges with "subplots_adjust"

  http://matplotlib.sourceforge.net/api/figure_api.html#matplotlib.figure.Figure.
subplots_adjust

There is also a pyplot command by the same name.

JDH

···

On Thu, Apr 2, 2009 at 3:11 PM, totallyunimodular <jhemann@...1899...> wrote:

I am interested in making spie charts in matplotlib, as discussed
http://www.nabble.com/forum/NewTopic.jtp?forum=2906 here and
http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=106 available
in R . Additionally, I would like to have a grid of such charts within a
single graphic frame, something along the lines of the
http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=63 star chart
demo in the R gallery, but with spie charts instead of star charts.

Brian Granger-2 wrote:

Wow, it is really striking how much better the matplotlib version of
this plot is compared to R. Very nice!

Brian

Brian, yes, I agree!

John Hunter-4 wrote:

Sorry forgot to answer your second question. You can create multiple
columns and rows of subplots using the subplot command. Here is an
example:

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

and here is the subplot tutorial

http://matplotlib.sourceforge.net/users/pyplot_tutorial.html#working-with-multiple-figures-and-axes

When working with lots-o-subplots, you may want to adjust the spacing
between them as well as around the edges with "subplots_adjust"

http://matplotlib.sourceforge.net/api/figure_api.html#matplotlib.figure.Figure.
subplots_adjust

There is also a pyplot command by the same name.

JDH

John, thanks for the helpful links. Thinking about my data more and what I
am trying to visualize I now think that the spie charts are not appropriate,
as they are intended for merging two pie charts based on the same underlying
context (e.g. expected proportions vs actual proportions). That being said,
I think the polar bar chart example you sent plus the example of how to have
a gridded layout of plots will get me what I need. I realize these examples
were right there in the gallery, but it helps to have people suggest things
sometimes, so thanks again for responding as you did and not (the seemingly
typical forum) "RTFM".

If what I come up with is different/interesting enough I'll work on
submitting it as an example to the matplotlib gallery.

Josh

···

--
View this message in context: http://www.nabble.com/spie-charts-in-matplotlib--tp22856064p22868864.html
Sent from the matplotlib - users mailing list archive at Nabble.com.