Add source example files
This commit is contained in:
13
source/plotting/plotly-test.py
Normal file
13
source/plotting/plotly-test.py
Normal file
@ -0,0 +1,13 @@
|
||||
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()
|
Reference in New Issue
Block a user