Jul-04-2021, 09:57 AM
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'.
I hope I stated a clear question.
Thank you already in advance!
Tim
I struggle finding good informations about 3D-piecharts online

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