views:

64

answers:

2

Is there a way to render a 3D pie in matplotlib? Or do you know at least a Python package that can generate 3D pies?

EDIT: I actually already knew about pygooglechart, but I'm looking for something that can be done offline. My apologies for forgetting to include this information. For those who offered pygooglechart, thanks for the effort, you have my votes. Question is still open for more ideas.

+4  A: 

Sure, you can use pygooglecharts, which is a python wrapper for Google Charts.

For instance:

from pygooglechart import PieChart3D

def python_pie3D() :
  # initialize chart object, 250 x 250 pixels
  chart = PieChart3D(250, 250)

  # pass your data to the chart object
  chart.add_data([398, 294, 840, 462])

  # make labels for the slices
  chart.set_pie_labels("Lithuania Bulgaria Ukraine Romania".split())

  # render the image
  chart.download('revenue_east_europe.png')

alt text

doug
+2  A: 

You can do this with the Google charts API. For example, using pygooglechart:

(Of course, there are reasons to avoid 3D pie-charts and even pie-charts in preference to other visualizations.)

ars
+1 for the informative links :)
Kit