2025.46 changes
This commit is contained in:
@@ -6,14 +6,12 @@ from plotly.graph_objs import Figure, Bar
|
||||
data = pd.DataFrame(data={
|
||||
"product": ["tarte", "gâteau", "biscuit", "mille-feuille", "éclair", "brownie"],
|
||||
"price": [2.99, 3.49, 1.99, 4.99, 5.99, 6.99],
|
||||
"weight": [250, 300, 200, 400, 500, 600]
|
||||
"weight": [400, 500, 100, 250, 150, 350]
|
||||
})
|
||||
figure: Figure = make_subplots(rows=1, cols=3, subplot_titles=("Prix", "Poids unitaires"))
|
||||
subplot = figure.get_subplot(row=1, col=2)
|
||||
subplot.xaxis["domain"] = [0.3555555, 1.0]
|
||||
print(subplot, dir(subplot))
|
||||
figure: Figure = make_subplots(rows=1, cols=2, subplot_titles=("Prix", "Poids unitaires"))
|
||||
# subplot = figure.get_subplot(row=1, col=2)
|
||||
# subplot.xaxis["domain"] = [0.3555555, 1.0]
|
||||
figure.add_trace(Bar(name="Prix", x=data["product"], y=data["price"]), row=1, col=1)
|
||||
figure.add_trace(Bar(name="Poids", x=data["product"], y=data["weight"]), row=1, col=2)
|
||||
figure.update_layout(template="seaborn", title="Prix et poids unitaires", font={"family": "Cabin", "size": 13})
|
||||
figure.update_traces(row=1, col=2, specs=2)
|
||||
figure.show(renderer="browser")
|
||||
|
||||
Reference in New Issue
Block a user