[enter image description here]

how can i change the colors of each sector?
Also, how can I put a caption pair for each line (pair of circles) ?
[enter image description here]

how can i change the colors of each sector?
Also, how can I put a caption pair for each line (pair of circles) ?
The method of changing the color of each pie chart is possible by specifying a color for each marker. Since no data is presented, I have edited the example in the reference to make the graph suitable for your purposes. The colors were determined by selecting two of the 24 colors in the default color map, combining them, and then extracting four similar colors from the list. If you already have a set of colors in mind, you can specify the number of colors you need in a list, for example. There is no way to add line labels, so I used string annotations.
from plotly.subplots import make_subplots
import plotly.graph_objects as go
import plotly.express as px
import numpy as np
import itertools
import random
#colors = ['gold', 'mediumturquoise', 'darkorange', 'lightgreen']
colors = px.colors.qualitative.Dark24 + px.colors.qualitative.Light24
fig = make_subplots(rows=4, cols=2, specs=[[{'type':'domain'}, {'type':'domain'}],
[{'type':'domain'}, {'type':'domain'}],
[{'type':'domain'}, {'type':'domain'}],
[{'type':'domain'}, {'type':'domain'}],
])
for r,c in itertools.product([1,2,3,4],[1,2]):
fig.add_trace(go.Pie(
labels=['Oxygen','Hydrogen','Carbon_Dioxide','Nitrogen'],
values=np.random.randint(500,5000,4),
marker=dict(colors=random.sample(colors,4), line=dict(color='#000000', width=2)
)), row=r, col=c
)
fig.update_traces(hoverinfo='label+percent', textinfo='value', textfont_size=12, showlegend=False)
for i in range(4):
fig.add_annotation(text='Row{}'.format(i+1), textangle=-90, font=dict(size=16), x=-0.1, y=0.05+0.31*i, xref='paper', yref='paper', showarrow=False)
fig.update_layout(autosize=True,
height=600,
width=800)
fig.show()