22 lines
703 B
Python
22 lines
703 B
Python
from typing import Iterable
|
|
|
|
from matplotlib import pyplot as plot
|
|
from matplotlib.axes import Axes
|
|
from matplotlib.figure import Figure
|
|
import matplotlib
|
|
|
|
if __name__ == '__main__':
|
|
matplotlib.use("QtCairo")
|
|
labels: Iterable[str] = ("Janvier", "Février", "Mars", "Avril")
|
|
values: Iterable[float] = (50, 11.4, 91, 66.1)
|
|
figure: Figure
|
|
axis: Axes
|
|
figure, axis = plot.subplots(nrows=1, ncols=1)
|
|
axis.bar(x=labels, height=values, color="#00ff00")
|
|
circle = plot.Circle((2, 20), 2, color="#FF0000", fill=False)
|
|
axis.set_ylabel("Précipitations (mm)")
|
|
axis.set_xlabel("Mois")
|
|
axis.set_title("Précipitations pour 2022")
|
|
axis.add_artist(circle)
|
|
plot.show()
|