14 lines
528 B
Python
14 lines
528 B
Python
import pandas as pd
|
|
from plotly import express
|
|
|
|
data = pd.DataFrame(data={
|
|
"product": ["pomme", "poire", "banane", "pêche"],
|
|
"price": [1.99, 2.49, 2.99, 3.49],
|
|
"wpu": [200, 180, 140, 200]
|
|
})
|
|
# Générer un graphique. Plotly express ne prend en charge qu'un seul graphique par figure
|
|
figure = express.bar(data, x="product", y="price", title="Prix", template="seaborn",
|
|
labels={"price": "Prix", "product": "Produit"})
|
|
figure.layout.update({"font": {"family": "Cabin", "size": 13}})
|
|
figure.show()
|