Vis Demo

Information & Interaction Design

Mick McQuaid

University of Texas at Austin

17 Nov 2026

Week THIRTEEN

Demoing Static Visual Design

Robert Johnson Page

This is a two part exercise.

  1. Create a style sheet
  2. Use the style sheet to create an actual webpage about the song “Hellhound on my Trail” by Robert Johnson

Style sheet

The style sheet can be a png, a pdf, or a jpg file containing the following elements.

  1. A color palette with about four or five colors
  2. A type guide, with at least two typefaces in several sizes
  3. A layout guide, such as a grid

Using the style sheet

  1. Create an actual webpage, not a Figjam
  2. Display the following information
    1. A picture of your choice
    2. The lyrics to “Hellhound on my Trail” (recorded 1937)
    3. Some biographical information about Robert Johnson (1911–1938)

Turning it in

In the Robert Johnson Page assignment box, provide the stylesheet and a link to the webpage. If you don’t have a place to host the webpage, put all the assets (the html file, a css file, and the picture file) in the assignment box so that they display there.

Demoing dynamic visual design

Superstore Visualization

This is a four part exercise.

  1. Specify a graphic using Bertin’s system
  2. Have an AI generate an R script from your specification
  3. Critique the result against your specification
  4. Revise

The assistant

Last week you pretended to give a table and a sketch to an assistant to polish. This week the assistant is an AI. It will write an R script using ggplot2, a package built on the ideas of Bertin and of Wilkinson (2005), whom we meet next week.

The data

Global Superstore is an Excel spreadsheet recording orders, returns, and people for a fictional store operating worldwide. We will use only the Orders worksheet, where each row is one line of an order.

Get the data

Download the spreadsheet from Canvas > Files > visualization > GlobalSuperstore.xls

Set up Posit Cloud

Posit Cloud runs R and RStudio in your browser, so there is nothing to install.

  1. Go to https://posit.cloud
  2. Sign up for the free plan
  3. In Your Workspace, click New Project, then New RStudio Project
  4. Give the project a name, such as superstore

Upload the data

  1. Find the Files pane in the lower right of RStudio
  2. Click Upload
  3. Click Choose File and select GlobalSuperstore.xls
  4. Click OK and wait for the file to appear in the Files pane

Read the data

Type the following in the Console pane, one line at a time. The first line may take a few minutes and you only need to run it once.

if (!require("pacman")) {
  install.packages("pacman")
}
pacman::p_load(tidyverse,readxl)
orders <- read_excel("GlobalSuperstore.xls", sheet = "Orders")

Look at the columns

glimpse(orders) lists every column, its type, and its first few values. You can also type View(orders) to browse the rows.

Stop here. We will look at the columns together.

Before we begin

In Canvas > Files > visualization, there is an example of a successful prompt, the resulting R script and the visual output. It’s the result of some knowledge of R, knowledge of data visualization, and familiarity with the superstore data.

What is a boxplot / jitterplot?

This is an example boxplot jitterplot pair, comparing two conditions in an experiment

The prompts

I need R code to conditionally install the pacman package. Then use pacman::p_load() to load the tidyverse and readxl.

I have a spreadsheet called GlobalSuperstore.xls in the working directory. I need R code to read the tab called Orders from it into a data frame called orders, then View the data frame.

From the orders data frame, I need an R script that shows ggplot-generated boxplots overlaid with jitter plots. The X axis is the column State and the Y axis is Profit. Only the six mostly frequently occurring states in the Country “United States” should be shown. Only consider orders in the Category “Furniture”. Each row represents a customer order. If a customer, represented by the column “Customer ID”, has more than one order, use the average profit from that customer. So the jitter plot should show one dot per customer rather than one dot per order. The dots in the jitter plot should have an alpha = 0.1 value so they’re more visible. The state labels on the X axis should be rotated 45 degrees so they don’t overlap. The states should be sorted by descending revenue. The boxes and jitter plots should be colored using the Blues color palette from ColorBrewer. The colors should be dictated by revenue, with the highest revenue state being the darkest blue.

The code

# Install pacman only if it's missing, then load packages
if (!requireNamespace("pacman", quietly = TRUE)) install.packages("pacman")
pacman::p_load(tidyverse, readxl)

# Read the Orders tab
orders <- read_excel("GlobalSuperstore.xls", sheet = "Orders")
View(orders)

# US furniture orders only
us_furniture <- orders |>
  filter(Country == "United States", Category == "Furniture")

# Six most frequently occurring states, with total revenue for each
state_revenue <- us_furniture |>
  group_by(State) |>
  summarize(n = n(), Revenue = sum(Sales)) |>
  slice_max(n, n = 6, with_ties = FALSE)

# One row per customer per state: average profit across that customer's orders
customer_profit <- us_furniture |>
  group_by(State, `Customer ID`) |>
  summarize(Profit = mean(Profit), .groups = "drop") |>
  inner_join(state_revenue, by = "State") |>
  mutate(State = fct_reorder(State, Revenue, .desc = TRUE))

# Boxplots overlaid with jitter plots, colored and sorted by state revenue
ggplot(customer_profit, aes(x = State, y = Profit, color = Revenue)) +
  geom_boxplot(outlier.shape = NA) +
  geom_jitter(width = 0.2, alpha = 0.1) +
  scale_color_distiller(palette = "Blues", direction = 1,
                        labels = scales::label_dollar()) +
  labs(
    title = "Average furniture profit per customer, top six US states",
    x = "State (sorted by descending furniture revenue)",
    y = "Average profit per customer",
    color = "State revenue"
  ) +
  theme(axis.text.x = element_text(angle = 45, hjust = 1))

The result

Part 1: Specify

Do this part without AI.

  1. Choose a question the Orders data can answer
  2. Write the invariant as a one-line title
  3. List the components
  4. Match each component to a variable
  5. Sketch the graphic

The invariant

The invariant is the topic of the graphic and gives the graphic its title, for instance Profit by market and product category.

The components

For each component, give

  • its order (raw or fraction)
  • its length (number of divisions)
  • its level (nominal, ordered, or quantitative)

The variables

Name what will carry each component: one of the two dimensions of the plane, or a retinal variable (size, value, texture, color, orientation, or shape).

The sketch

Sketch the graphic on paper or on a tablet. Include the title, the axes, and a legend for each component.

Part 2: Generate

Give an AI of your choice

  1. Your specification
  2. The output of glimpse(orders), pasted from the Console, so that the AI knows the column names
  3. A request for an R script using ggplot2 that reads the Orders worksheet of GlobalSuperstore.xls

Keep a log of every prompt you write.

Save your prompt log

The log is a document listing every prompt you wrote, in order. Save it in one of these ways.

  1. Keep a document open and paste each prompt into it as you send it
  2. When you finish, scroll back through the chat and copy each of your prompts into a document
  3. If your AI offers a share link to the chat, add the link to the document as well

Include prompts that failed. Do not edit them.

Run the script

  1. In RStudio, click File, then New File, then R Script
  2. Paste the script and save it as superstore.R
  3. Click Source to run it
  4. If you see an error, paste the error message back to the AI

Part 3: Critique

Compare the chart to your specification and your sketch.

  • Where did the AI depart from your specification?
  • What did the AI choose that you did not ask for, such as a color scale, a sort order, or an axis range?
  • Does each component have a legend?
  • Does the chart answer your question at a glance?

Part 4: Revise

Prompt the AI at least once more to repair what you found in the critique. Note what you changed and why.

Save the chart

Add this line to the end of the script and run the script again.

ggsave("superstore.png", width = 8, height = 5)

To download a file from Posit Cloud, check its box in the Files pane, click More, then Export.

Turning it in

In the Superstore Visualization assignment box, provide the following.

  1. Your specification: invariant, components, variables, and sketch
  2. Your prompt log
  3. The final R script and the final chart
  4. Your critique, including what you revised and why

END

References

Wilkinson, Leland. 2005. The Grammar of Graphics (Statistics and Computing). Springer-Verlag.

Colophon

This slideshow was produced using quarto

Fonts are Fira Sans, Fira Sans Light, and Victor Mono Nerd Font

Math is set in Fira Math via MathJax 4