The easiest way to create plots in Python and Matplotlib. The plotai is using LLM to generate code and plots.<p>The idea:<p>1. User provides input DataFrame and prompt.<p>2. The PlotAI constructs a prompt for LLM, which contains the first 5 rows of DataFrame and the user's prompt and asks for Python code as output.<p>3. Returned Python code is executed, and the plot is displayed.<p>The simplest possible API for plotting:<p><pre><code> # import packages
import pandas as pd
from plotai import PlotAI
# create some data
df = pd.DataFrame({"x":[1,2,3], "y": [4,5,6]})
# do a plot
plot = PlotAI(df)
plot.make("scatter plot")
</code></pre>
The PlotAI class has only one method, make().<p>It works in Python scripts and in notebooks (Jupyter, Colab, VS Code).