Files
training.python.datascience/source/plotting/charts/plotly_figure_bar.py
2025-10-24 22:29:15 +02:00

15 lines
418 B
Python

import pandas as pd
from plotly.graph_objs import Figure, Bar
if __name__ == '__main__':
df = pd.DataFrame(data={"label": ["Citron", "Pomme", "Mangue"], "price": [1.99, 3.97, 6.8]})
figure = Figure(
data=[Bar(x=df["label"], y=df["price"])],
layout={
"font": {"family": "Cabin", "size": 20},
"title": "Prix au kilo",
}
)
figure.show(renderer="browser")