3D-Piechart - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Data Science (https://python-forum.io/forum-44.html) +--- Thread: 3D-Piechart (/thread-34173.html) |
3D-Piechart - timste - Jul-04-2021 Hi I struggle finding good informations about 3D-piecharts online . 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'. 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 RE: 3D-Piechart - snippsat - Jul-04-2021 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 RE: 3D-Piechart - timste - Jul-04-2021 (Jul-04-2021, 11:12 AM)snippsat Wrote: If i do a quick test Notebook Thank you! But these links only contain information about 2D-piecharts. Not about my desired 3D-piechart. RE: 3D-Piechart - jefsummers - Jul-08-2021 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) |