objectif
Tracer des séries/df rapidement via .plot().
code minimal
import pandas as pd
s = pd.Series([1,3,2])
ax = s.plot(kind="line", title="demo")
print(hasattr(ax, "plot"))
utilisation
import pandas as pd
df = pd.DataFrame({"a":[1,2,3], "b":[3,2,1]})
ax = df.plot(kind="bar")
print(ax.get_legend() is not None)
variante(s) utile(s)
import pandas as pd
df = pd.DataFrame({"x":[1,2,3], "y":[1,4,9]})
ax = df.plot.scatter(x="x", y="y")
print(ax.has_data())
notes
- Pour personnaliser finement, utilisez matplotlib directement.