Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

3D pie graph in matplotlib or other python package

Is there a way to render a 3D pie in matplotlib, or is there 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.

like image 460
Kit Avatar asked Nov 03 '25 20:11

Kit


1 Answers

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

PyPi: pygooglechat 0.4.0: Released: Apr 20, 2014

GitHub: pygooglechart: Project Abandoned

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

like image 90
doug Avatar answered Nov 05 '25 11:11

doug



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!