I want all the Mammals to be yellow, and all reptiles to be green. I can't use plot express because my school doesn't allow it. Code is as follows:
import plotly.graph_objs as go
fig = go.Figure(go.Sunburst(
labels=["Animal", "Reptile", "Lizard", "Snake", "Bird", "Salamander",
"Canary", "tweetle", "Mammal", "Equine", "Bovine", "Canine",
"Horse", "Zebra", "Cow", "Lassle", "Rintintin", "Bessle"],
parents=["", "Animal", "Reptile", "Reptile", "Reptile", "Lizard",
"Bird", "Canary", "Animal", "Mammal", "Mammal", "Mammal",
"Equine", "Equine", "Bovine", "Canine", "Canine", "Cow"],
))
fig.update_layout(margin = dict(t=0, l=0, r=0, b=0))
fig.show()
