Investigation: Visualization through human eyes

Investigation: Visualization through human eyes#

A useful figure supports a specific reader task. Legibility, uncertainty, meaningful comparisons, and accessible encodings matter more than maximizing density or removing every gridline. Design choices must not change the evidentiary claim.

Question. Compare a crowded colored scatterplot with small multiples and explicit axis labels. Show participant-level summaries with intervals.

Before running: write the result you expect and what would challenge it. Data are simulated unless explicitly identified otherwise.

# Open this notebook from book/notebooks (or book/exercises).
course_path <- if (file.exists("../R/course.R")) "../R/course.R" else "book/R/course.R"
stopifnot(file.exists(course_path))
source(course_path)
set.seed(432)
d <- simulate_trials(n_subjects=9)
plot(d$frequency,d$rt,col=as.integer(d$subject),pch=16,xlab="Frequency",ylab="RT")
par(mfrow=c(3,3),mar=c(3,3,2,1))
for(id in levels(d$subject)) {
  z <- d[d$subject==id,]
  plot(z$frequency,z$rt,pch=16,col="steelblue",xlim=range(d$frequency),ylim=range(d$rt),main=paste("Participant",id),xlab="Word frequency",ylab="RT (ms)")
}
par(mfrow=c(1,1))

Compare comprehension#

Ask a partner to identify high-baseline participants and the direction of the frequency relationship. Keep common axes for this comparison. Use labels or shapes in addition to color, and do not remove references needed to read values.

means <- aggregate(rt~subject,d,mean)
means <- means[order(means$rt),]
plot(means$rt,seq_len(nrow(means)),pch=16,yaxt="n",xlab="Mean RT across the same simulated items (ms)",ylab="Participant")
axis(2,at=seq_len(nrow(means)),labels=means$subject,las=1)
grand <- mean(means$rt)
interval <- grand+c(-1,1)*qt(.975,nrow(means)-1)*sd(means$rt)/sqrt(nrow(means))
data.frame(mean_ms=grand,lower=interval[1],upper=interval[2])
A data.frame: 1 × 3
mean_mslowerupper
<dbl><dbl><dbl>
634.3331599.7052668.9611
../_images/15f4ee6c30d5b2659c433893ef4cef5b0c0d65b221f0f73106c41a3bd68da635.png

The interval treats participants as independent sampling units conditional on this fixed item set. It does not describe the distribution of trial reaction times or uncertainty over new words. A suitable caption names the units and this limitation. Avoid rotation of text unless it improves readability for the specific layout.

Interpret and verify#

Ask a partner to answer the same numerical and qualitative questions from two designs. Revise using their errors, not only aesthetic preferences.

Failure to consider: Changing axis limits, hiding variation, or relying on color alone can alter the apparent story without changing the data.

Report the target, the numerical result with its units, the relevant uncertainty, and one limitation. Distinguish what is established by the simulation from what would require real data.

AI audit: critique the saved faulty claim in the companion exercise before using any live assistant. If you use AI, record the relevant suggestion, your independent check, and the final decision.

Build on exploratory plots and carry clear uncertainty displays into model evaluation.

sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS 15.7.7

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib

locale:
[1] C.UTF-8/C.UTF-8/C.UTF-8/C/C.UTF-8/C.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] fansi_1.0.3         crayon_1.5.1        digest_0.6.29      
 [4] utf8_1.2.2          IRdisplay_1.1       repr_1.1.4         
 [7] lifecycle_1.0.1     jsonlite_1.8.0      evaluate_0.15      
[10] pillar_1.8.0        rlang_1.0.6         cli_3.3.0          
[13] uuid_1.1-0          vctrs_0.4.1         IRkernel_1.3.0.9000
[16] tools_4.2.1         glue_1.6.2          fastmap_1.1.0      
[19] compiler_4.2.1      base64enc_0.1-3     pbdZMQ_0.3-7       
[22] htmltools_0.5.3    

Attribution#

Notebook authored by Amy Sentis.

Revised investigation: 2026 course revision. Original authorship is retained; examples and explanatory text have been updated.