justplotme: GPT3.5 to just plot things

code: https://github.com/nuwandavek/justplotme

justplotme is a python library that uses openai’s GPT-3.5 to do the AGI level task of just plotting things. It creates plots from a pandas DataFrame and a query, inside a Jupyter notebook widget. It uses the wonderful anywidget library to create a simple widget that you can run in your notebooks. Natural language based data exploration is fascinating, and I have been very excited about what it means for data science in general.

justplotme in action

Why?

I create >25 plots a day, using unnecessarily complicated plotting libraries with their own APIs. I really thought there would be tools I would already be using, integrating LLMs into my work flow. It is ~2 years now since the release of GPT-3.5 and the best tool out there is still ChatGPT. I’ve seen Julius and other data-science-adjacent platforms. I don’t want any of that. I simply want to integrate things into my own workflow - don’t want move data across platforms. Also, I hate the linear input-output structure of ChatGPT. It works great for answering questions, or giving code suggestions. But for data analysis / exploration, I want the data entity I am working on to stay on a part of the screen, and I want to iteratively modify it with text. justplotme is an experiment with this basic structure. It doesn’t do anything right now, except giving one line plotly expressions to generate plots.

To use this in a notebook:

! pip install justplotme

import os
from justplotme import PlotMe
OPENAI_KEY = os.getenv("OPENAI_API_KEY")
# df is a pandas DataFrame
PlotMe(df, api_key=OPENAI_KEY)

What next?

Firstly, I want to support this widget across multiple notebook platforms (at least all the ones anywidget supports). Jupyter widgets are a really powerful paradigm that are underexplored for LLM based data interactions. Auto-visualizations based on data fields, viz suggestions, goal-motivated aggregations and querying are some exciting directions this could take. But for now, it just plots things. Do give it a try!