How to Make a Bubble Chart with ChatGPT
Want to turn that spreadsheet of marketing data into a clear, compelling bubble chart without sinking hours into a complex BI tool? Using ChatGPT is a surprisingly effective way to get the job done quickly. This article will walk you through the entire process, from preparing your data and writing the perfect prompt to generating your final chart.
What is a Bubble Chart (And Why Use One)?
Think of a bubble chart as a souped-up scatter plot. While a scatter plot compares two different numerical values along an X and Y axis, a bubble chart adds a third dimension: the size of the bubble. This makes it perfect for visualizing three distinct pieces of data for each category at once.
For example, you could analyze marketing campaigns using:
- X-axis: Ad Spend
- Y-axis: Click-Through Rate (CTR)
- Bubble Size: Total Conversions
With a single glance, you can spot the campaigns that have a high CTR and high conversions but maybe came from a lower ad spend - the kind of insight that's hard to find just by looking at rows of numbers.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
How ChatGPT Helps with Data Visualization
It's important to understand that ChatGPT isn't a visualization tool like Tableau or Looker. You can't drag and drop elements or connect a live data source. Instead, ChatGPT acts as your brilliant, on-demand coder.
You provide the data and describe the chart you want, and ChatGPT writes the necessary Python code (using popular data visualization libraries like Matplotlib or Plotly) to create it. Your job is simply to copy that code and run it in a free and easy-to-use environment - which we’ll cover in a moment. The final output is typically a static image file (.png or .jpg), which is perfect for dropping into presentations, reports, or emails.
Step 1: Get Your Data Ready
The saying "garbage in, garbage out" is especially true with an AI model. For ChatGPT to succeed, your data needs to be clean, organized, and straightforward. The best format is a simple CSV text structure with a clear header row.
A bubble chart requires at least four columns:
- One categorical column: This will be used to label your bubbles (e.g., Campaign Name, Product Name, Country).
- Three numerical columns: One for the x-axis, one for the y-axis, and one for the bubble size.
Let's use a marketing campaign dataset as our example. Here’s what the raw data could look like, ready to be copied into our prompt:
Campaign,Spend,CTR,Conversions Summer Sale,5200,2.5,150 Q4 Holiday Push,11500,3.8,420 Spring Refresh,7800,3.1,280 Influencer Collab,4000,4.5,350 Content Series,6500,1.9,110
Step 2: Write a Clear and Specific Prompt
The quality of your prompt directly impacts the quality of ChatGPT’s output. Vague requests lead to generic charts. For the best results, structure your prompt with a few key pieces of information.
The Essential Prompt Components
- Your Goal: State clearly that you want to create a bubble chart using Python. Specifying the library (like Matplotlib or Plotly) is helpful.
- Your Data: Paste the clean data directly into the prompt. For datasets with more than 20-30 rows, it's better to upload the CSV file if you're a ChatGPT Plus user.
- Your Axis and Size Mapping: Explicitly tell ChatGPT which column should be on the x-axis, the y-axis, and which should determine the bubble size.
- Your Labels: Tell it which column to use for labeling each bubble.
- Cosmetic Details: Include requests for a chart title, axis labels, specific colors, and font sizes to get a more polished result from the start.
An Example Prompt in Action
Using our sample marketing data, here is a detailed prompt that follows the structure above:
Please generate Python code using the pandas, matplotlib, and seaborn libraries to create a bubble chart from the following data.
My data is structured as follows: Campaign,Spend,CTR,Conversions Summer Sale,5200,2.5,150 Q4 Holiday Push,11500,3.8,420 Spring Refresh,7800,3.1,280 Influencer Collab,4000,4.5,350 Content Series,6500,1.9,110
Please use this mapping for the chart:
- X-axis: 'Spend'
- Y-axis: 'CTR'
- Bubble Size: 'Conversions'
Additionally, please include the following details:
- Label each bubble with its corresponding 'Campaign' name. Make sure the labels don't overlap.
- Set the chart title to "Marketing Campaign Performance Analysis".
- Label the x-axis as "Advertising Spend ($)".
- Label the y-axis as "Click-Through Rate (%)".
- Scale the bubble sizes for clear visual distinction (e.g., multiply 'Conversions' values by 5 for the size parameter).
- Add a light grid for better readability.
- Generate the code needed to save the chart as a PNG file.
This level of detail helps ChatGPT avoid guesswork and produces code that is much closer to what you want on the first try.
Step 3: Run the Code and Generate Your Chart
Once ChatGPT gives you the Python code, you need a place to run it. You don't need to install anything on your computer. The easiest way is to use a free tool called Google Colab.
Follow these simple steps:
- Open Google Colab: Navigate to colab.research.google.com.
- Create a New Notebook: Click the "New notebook" button in the bottom-right corner of the pop-up window.
- Paste the Code: Copy the entire block of Python code provided by ChatGPT and paste it into the first cell of your new notebook.
- Run the Cell: Click the "play" button to the left of the code cell. The first time you run it, it may take a few seconds to connect to a runtime.
Once the code has finished running, your bubble chart image should appear directly below the code cell. You can then right-click on the image and select "Save image as..." to download it to your computer.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
The Drawbacks of Using ChatGPT for Charts
This method is fantastic for quick, one-off visualizations, but it's important to recognize its limitations, especially for ongoing business reporting.
- Charts are Static: The output is a snapshot in time. If your data changes tomorrow, you have to go through the entire process again - get the new data, re-prompt, re-copy the code, and re-run it. It’s not sustainable for performance tracking.
- There is No Interactivity: The chart is just an image. You can't hover over a bubble to get more details, filter out certain campaigns, or drill down into the underlying data.
- Data Handling is Manual: It relies entirely on you manually providing clean data every single time. There is no direct connection to your data sources, which means the process is time-consuming and prone to human error.
- Room for AI Errors: ChatGPT guesses the context of your data, and it can sometimes get things wrong if your dataset is complex or the prompts aren't super specific. It's an intelligent assistant, but not a true data analyst.
Final Thoughts
Creating a bubble chart with ChatGPT is an excellent way to generate fast, one-off visualizations without needing specialized software or coding experience. By preparing your data properly, writing a specific prompt, and using a simple tool like Google Colab, you can turn a basic dataset into a powerful visual in just a few minutes.
While this is great for an occasional report, the manual process isn't built for a world of constantly changing data. That’s exactly why we created Graphed. Instead of exporting CSVs to create a static image, you just connect your sales and marketing platforms once. After that, you can use plain English to ask for a bubble chart - or any analysis - and get a live, interactive dashboard that updates itself, helping you move from manual reporting to immediate, actionable insights.
Related Articles
How to Create Facebook Ads API for Claude Code
Create a Meta Marketing API access token that never expires, using a system user, so Claude Code can pull Facebook ad reports and manage campaigns.
ClickHouse vs Postgres: When to Switch to Columnar
Comparing ClickHouse vs PostgreSQL means matching storage architecture to workload. Row storage wins for transactions. Columnar wins for scan-heavy analytics.
Google Ads for Orthodontists: Get More Booked Consults
Most orthodontic Google Ads campaigns waste money on low-intent searches. The problem is structure, not the platform.