Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
3D-Piechart
#1
Hi
I struggle finding good informations about 3D-piecharts online Dodgy . So I wanted to ask you how I create three (one for each row) 3D-piecharts out of this dataframe.

The depth/height of the piechart should be the value in the column 'depth'. And the size of the entire pie should be the value in column 'vol_tot'. So I can visually compare the three rows.

The pie-pieces of each piechart correspond to the values in columns 'vol_1', 'vol_2', 'vol_3'. Smile

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt  

vol_1 = [0.05, 0.05, 0.1]
vol_2 = [0.1, 0.4, 0.7]
vol_3 = [0.3, 0.5, 0.8]
vol_tot= [0.7, 1.1, 1.8]
depth= [0.4, 1, 1.6]
labels = ['glass', 'bottle', 'jug']

df = pd.DataFrame({'vol_tot':vol_tot,'vol_1': vol_1, 'vol_2': vol_2, 'vol_3': vol_3, 'depth': depth}, index=labels)
The result would be three 3D-piecharts with different sizes and heights.
I hope I stated a clear question.
Thank you already in advance!
Tim
Reply
#2
If i do a quick test Notebook
Doc for pandas pandas.DataFrame.plot.pie.

For more examples look at
The Python Graph Gallery
Data Viz Libraries Compared
Pie Charts in Python
Reply
#3
(Jul-04-2021, 11:12 AM)snippsat Wrote: If i do a quick test Notebook
Doc for pandas pandas.DataFrame.plot.pie.

For more examples look at
The Python Graph Gallery
Data Viz Libraries Compared
Pie Charts in Python

Thank you! But these links only contain information about 2D-piecharts. Not about my desired 3D-piechart.
Reply
#4
Save you some time though unfortunately not a great answer. There is no 3d pie chart support in matplotlib, seaborn, or plotly. The only library I found that does support the type of 3d pie chart with variable thickness that you want is a product called ChartDirector, but it is not free (and is a bit pricey)

Alternative is to take your data, export as an xls then create your 3d chart in Excel or one of the alternatives (I checked and Open Office Calc does 3d pies)
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020