How to plot multiple pie charts side-by-side in plotly from Python?

Viewed 1370

How do you plot more than 2 pie charts using plotly? For example, how do you put two more plots in the two pie charts as seen here:

`import plotly.plotly as py
 import plotly.graph_objs as go
 fig = {
 "data": [
{
  "values": [16, 15, 12, 6, 5, 4, 42],
  "labels": [
    "US",
    "China",
    "European Union",
    "Russian Federation",
    "Brazil",
    "India",
    "Rest of World"
  ],
  "domain": {"x": [0, .48]},
  "name": "GHG Emissions",
  "hoverinfo":"label+percent+name",
  "hole": .4,
  "type": "pie"},     
{
  "values": [27, 11, 25, 8, 1, 3, 25],
  "labels": [
    "US",
    "China",
    "European Union",
    "Russian Federation",
    "Brazil",
    "India",
    "Rest of World"
  ],
  "text":"CO2",
  "textposition":"inside",
  "domain": {"x": [.52, 1]},
  "name": "CO2 Emissions",
  "hoverinfo":"label+percent+name",
  "hole": .4,
  "type": "pie"
 }], 
 }}
       py.iplot(fig, filename='donut')

What does domain mean in this case? What are alternative ways to plot multiple pie charts using plotly?

1 Answers
Related