Data Visualization Examples: How to Transform 2D Data into Box-and-Whisker Charts with AI

Data Visualization Examples: How to Transform 2D Data into Box-and-Whisker Charts with AI

Data Visualization Examples: How to Transform 2D Data into Box-and-Whisker Charts with AI

Data Visualization Examples: How to Transform 2D Data into Box-and-Whisker Charts with AI

Feb 14, 2025

Feb 14, 2025

4 min read

4 min read

Welcome to the AI and Statistics series!

Let's dive into how AI can transform tabular data into various types of charts.

Today, we will be converting a 2D data table into a columnar format and generating two types of Box & Whisker Charts to compare visualizations with grouping variables on the X-axis and Y-axis.

Don't worry about using the AI Agent-driven Bayeslab, all you need is natural language to get the data analysis result.

All content will be explained in the most comprehensible natural language descriptions to help you get started with data analysis from scratch.

We’ll start with a data table featuring California weather data from 2024-01-01 to 2025-01-31. This table includes monthly maximum, minimum, and mean temperature values.

The Box & Whisker charts will illustrate temperature variations with group variables depicted on both the X-axis and Y-axis for comparison.

We’ll delve into how these prompts influence the final charts and uncover techniques for effective data visualization.

In just 2 minutes, you'll learn to transform complex datasets into insightful visualizations. Let's start it right now.

Using different prompt inputs, we'll demonstrate how AI generates two Box & Whisker chart results; our steps will include:

Step 1 - Table Structure Processing

Step 2 - Box & Whisker on X-axis

Step 3 - Box & Whisker on Y-axis


Step 1 - Table Structure Processing

Process the raw table to create a columnar format where months are columns and temperature statistics are rows.

Prompt:

Read  California 2024-01-01 to 2025-01-31.csv  create a new table in the columnar format.

Columns: The column headers are the months from Jan to Dec.

Rows: The column header for rows is empty, and the titles for the rows are Lower, Mean, and Upper.

This table should present the maximum, minimum, and mean values for each month.

Save the resulting table locally with the name "Temperature". Ensure that all numeric data is saved with 3 decimal places.

Additionally, "columnar format" means that the columns have grouping variables, while the rows do not have grouping variables but have titles (the column header for the row titles is empty).

Step 2 - Box & Whisker on X-axis

Generate a Box & Whisker chart with grouping variables on the X-axis, displaying temperature data for each month.

Prompt:

Read  Temperature.csvTemperature.csv This represents the temperature data for each month, from January to December, with maximum, minimum, and mean values.

This is a columnar table:

Rows do not have grouping variables, but they have titles in the first column, where the column header is empty.

Columns have grouping variables, which are Jan, Feb, and so on, representing data from January to December.

Step 1: Iterate through all the column names. If a column header is empty but the rows below have data, name the column as "F". If there are multiple columns with data but no headers, name them sequentially as F1, F2, F3, and so on.Step 2: Generate a chart with the following requirements:

Generate a boxplot using this table data.

Step 3 - Box & Whisker on Y-axis

Switch to display a Box & Whisker chart with grouping variables on the Y-axis, for the same dataset, showcasing an alternative view.

Prompt: [Additional part in finetuning button]

(…same with Step2 , but add one sentence additionally)

Generate box &whisky in Y axis

Thank you for reading this installment of the AI and Statistics series!

We demonstrated how to process a 2D data table into a columnar format and generate two types of Box & Whisker charts, comparing visualizations on the X-axis and Y-axis.

Stay tuned for our upcoming demonstrations to explore more fascinating data visualization.

Using AI Agent and Bayeslab, anyone can organize, analyze, plot data charts, and make business data predictions like a professional data analyst based on previous data.

Bayeslab makes data analysis as easy as note-taking!

Bayeslab makes data analysis as easy
as note-taking!

Start Free

Bayeslab makes data analysis as easy as note-taking!

Bayeslab makes data analysis as easy as note-taking!