Data visualization is a crucial skill for anyone working with data. Creating beautiful, informative visualizations can be time-consuming and often requires specialized tools.
Fortunately, with its latest updates, ChatGPT makes data visualization faster and easier than ever before. Instead of switching between different tools, you simply need to type a prompt, and ChatGPT will generate the desired visualizations for you.
In this tutorial, we'll explore how to instantly create various data visualizations using plain English prompts with ChatGPT.
We’ll start with simple pie and bar charts, then tackle more complex visualizations using real-world datasets.
Simple Charts
Let's begin with basic visualizations. We'll write simple prompts to generate plots from data in the form of a Python dictionary.
Pie Chart
Ensure you are using the GPT-4 or GPT-4o model, as they support generating visualizations.
Here’s how you can generate a pie chart visualization based on nutrient data, and customize the color scheme:
Prompt:
Generate a pie chart of values {"Vitamin A": 15, "Vitamin B": 30, "Vitamin C": 30, "Water": 25} with a light color combination.

ChatGPT will produce a pie chart with the specified values and a lighter color palette (which you can always modify by asking ChatGPT to use other colors).
You can view and modify the Python code behind the visualization by clicking the terminal logo at the end of the result.
Bar Chart
Next, let’s create a bar plot for CO2 emissions of different cars.
Prompt:
Generate a bar plot of CO2 emissions with values {"Car A": 100, "Car B": 45, "Car C": 20}.

More basic charts
In addition to pie and bar charts, ChatGPT is also able to generate these basic charts:
- Line Chart: Useful for showing trends over time.
- Histogram: Shows the distribution of a single variable.
- Scatter Plot: Used to examine the relationship between two variables.
Because we have a lot more to cover, we won't show how each one of them looks like in ChatGPT.
But if you want to, just ask the chatbot to make the basic chart you want based on the list above and it will be made in a matter of seconds.
Advanced charts
ChatGPT is also capable of more advanced graphics. This is ideal for data analysts who need to quickly perform advanced visual analyses, while saving hours of work.
In this tutorial, we will use the Customer Shopping Trends dataset. Please download it and give it to ChatGPT.
Box plot
Box plots are useful for visualizing the distribution, central tendency, and variability of data, including identifying outliers.
Prompt:
Could you use the dataset I gave you and make a box plot chart?

Heatmap
Heatmaps are useful for visualizing the intensity of values in a matrix format, revealing patterns, correlations, and clusters within the data.
Prompt:
Could you use the dataset I gave you and make a heatmap?

Pair plot
Pair plots are useful for visualizing relationships and correlations between multiple pairs of numerical features in a dataset.
Prompt:
Could you use the dataset I gave you and make a pair plot?

Swarm plot
Swarm plots are useful for visualizing the distribution of individual data points within categories, showing their relative density and grouping.
Prompt:
Could you use the dataset I gave you and make a swarm plot?

Violin plot
Violin plots are useful for visualizing the distribution, density, and probability of data across different categories.
Prompt:
Could you use the dataset I gave you and make a violin plot?

Exploratory data analysis
Instead of micro-managing ChatGPT's output, you can ask it to autonomously create results, much like various Python AutoViz libraries. Simply provide the dataset and request a complete exploratory data analysis to generate all necessary plots.
For example, using the same Customer Shopping Trends dataset we used before, we can gain insights into consumer behavior and purchasing patterns.
Prompt:
Perform exploratory data analysis on this dataset and display only plots





This would normally take hours to make.
Enhance your analysis by drawing a correlation diagram, bar chart, pie chart, box plot and relationship diagram.
You can improve results by providing follow-up prompts for the type of visualization you're interested in.
Enhance your analysis by drawing a correlation diagram, bar chart, pie chart, box plot and relationship diagram.



Want to see even more complex visualizations?
Use this prompt:
Use the dataset to plot various complex visualizations.



