Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to plot 3D Bar chart/ Pie Chart/ Donut using Plotly

I have found code to make bar charts and pie charts in plotly also other 3D plots. A simple bar chart works like this:

from  plotly.offline import plot
from plotly.graph_objs import *
trace1 = Bar(
    x=['cats', 'dogs', 'monkeys'],
    y=[20, 14, 23]
)
data = Data([trace1])
plot(data)

Is there any option available in plotly to plot this bar graph in 3D layout. Also for pie chart/donut also?

like image 673
Naima Avatar asked Oct 16 '25 03:10

Naima


1 Answers

Have a look at the official documentation: https://plot.ly/python/3d-charts/

As this should be a list of all available 3D Charts in plot.ly:

No, it seems there is currently no option for 3D Bar/Pie/Donut.

See also: https://community.plot.ly/t/will-there-be-3d-bar-charts-in-the-future/1045/2

Bar/Pie/Donut are two-dimensional by nature, making them 3D would provide no additional value (apart from cosmetics)

As suggested in the link above, you could try using 3D filled line plots.

Though I doubt that the additional complexity required to get the desired result is worth it.

like image 113
Sebastian Loehner Avatar answered Oct 18 '25 16:10

Sebastian Loehner



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!