Skip to main content

Create plots in Python with AI

Project description

PlotAI logo

🎨🤖 Create Python plots in matplotlib with LLM 🎨🤖

🚀 Get Started   •   🤝 Issues   •   🐦 Twitter   •   👩‍💼 LinkedIn

PlotAI 🎨🤖

The easiest way to create plots in Python and Matplotlib. The plotai is using LLM to generate code and plots.

The idea:

  1. User provide input DataFrame and prompt.
  2. The PlotAI constructs a prompt for LLM which contains first 5 rows of DataFrame and user's prompt and asks for Python code as output.
  3. Returned Python code is executed and plot is displayed.

https://github.com/mljar/plotai/assets/6959032/cb80bc35-e534-466d-aa1d-ce240d35f624

Get started

Install plotai package:

pip install plotai

Create .env file with OpenAI API key:

OPENAI_API_KEY=your-key-here

You can also pass OpenAI API key in Python

import os
os.environ["OPENAI_API_KEY"] = "your-key-here"

Import plotai and make plots:

# import PlotAI
from plotai import PlotAI

# create PlotAI object, pass pandas DataFrame as argument
plot = PlotAI(df)

# make a plot, just tell what you want
plot.make("make a scatter plot")

More examples

Analyze GPD dataset

Contents of video:

https://github.com/mljar/plotai/assets/6959032/e62b1a26-7c91-40e4-9d2d-1a600d8dd7ba

Analyze Iris dataset

👩‍💼🐦 Connect with Us on LinkedIn & Twitter

Stay up-to-date with the latest updates about PlotAI 🎨🤖 by following us on Twitter (MLJAR Twitter) and LinkedIn (Aleksandra LinkedIn & Piotr LinkedIn). We look forward to connecting with you and hearing your thoughts, ideas, and experiences with PlotAI. Let's explore the future of AI together!

⚠️ Limitations

🛡 Disclaimer

This project, PlotAI, is provided "as-is" without any warranty, express or implied. By using this software, you agree to assume all risks associated with its use, including but not limited to data loss, system failure, or any other issues that may arise. The developers and contributors of this project do not accept any responsibility or liability for any losses, damages, or other consequences that may occur as a result of using this software.

Please note that the use of the OpenAI language models can be expensive due to its token usage. By utilizing this project, you acknowledge that you are responsible for monitoring and managing your own token usage and the associated costs. It is highly recommended to check your OpenAI API usage regularly and set up any necessary limits or alerts to prevent unexpected charges.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plotai-0.0.2.tar.gz (11.7 kB view details)

Uploaded Source

File details

Details for the file plotai-0.0.2.tar.gz.

File metadata

  • Download URL: plotai-0.0.2.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for plotai-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f63fe6565e908d4e28a9266dcb8b63b23eeb667808b56e2da43ca71e87a545c6
MD5 3650815a93bc1100be5045d316f558d6
BLAKE2b-256 ad67683352e68db6f1a86e3b780d04132b5b334cde464e46c5a8ab5eb8b43c7e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page