Gestalt Hierarchy | Graphs |
---|---|
Enclosure | Facets |
Connection | Lines |
Proximitiy | White Space |
Similarity | Color/Shape |
Using ggplot2
What makes bad figures bad?
What makes bad figures bad?
issues can be (1) aesthetic, (2) substantive, and/or (3) perceptual
Edward R. Tufte is a better known critic of this style of visualization
Graphical excellence is the well-designed presentation of interesting data and consists of:
complex ideas communicated with clarity, precision, and efficiency
maximizes the “data-to-ink” ratio.
nearly always multivariate
requires telling the truth about the data.
defines “chartjunk” as superfluous details
What makes bad figures bad?
issues can be (1) aesthetic, (2) substantive, and/or (3) perceptual
bad data
What makes bad figures bad?
issues can be (1) aesthetic, (2) substantive, and/or (3) perceptual
Looking at pictures of data means looking at lines, shapes, and colors
Our visual system works in a way that makes some things easier for us to see than others
“Preattentive” features
Gestalt Principles
color and contrast
Graphics consist of:
Structure: boxplot, scatterplot, etc.
Aesthetics: features such as color, shape, and size that map other characteristics to structural features
Both the structure and aesthetics should help viewers interpret the information.
What sorts of relationships are inferred, and under what circumstances?
Proximity: Things that are spatially near to one another are related.
Similarity: Things that look alike are related.
Enlosure: A group of related elements are surrounded with a visual element
Symmetry: If an object is asymmetrical, the viewer will waste time trying to find the problem instead of concentrating on the instruction.
Closure: Incomplete shapes are perceived as complete.
Continuity: Partially hidden objects are completed into familiar shapes.
Connection: Things that are visually tied to one another are related.
Figure/Ground: Visual elements are either in the foreground or the background.
Gestalt Hierarchy | Graphs |
---|---|
Enclosure | Facets |
Connection | Lines |
Proximitiy | White Space |
Similarity | Color/Shape |
Implications for practice + Know how we perceive groups + Know that we perceive some groups before others + Design to facilitate and emphasize the most important comparisons
Location WaterTemp Time AvgTemp
cheek:6 indoor :12 pre :8 Min. :48.60
elbow:6 outdoor:12 post1:8 1st Qu.:67.67
palm :6 post2:8 Median :84.25
pec :6 Mean :78.70
3rd Qu.:89.83
Max. :95.40
Research question: Does the average body temperature recovery as recorded at the four body points depend on water temperature?
Research question: Does the average body temperature recovery as recorded at the four body points depend on water temperature?
Pre-Attentive Features are things that “jump out” in less than 250 ms
There is a hierarchy of features
Color is stronger than shape
Combinations of pre-attentive features are usually not pre-attentive due to interference
Hue: shade of color (red, orange, yellow…)
Intensity: amount of color
Both color and hue are pre-attentive. Bigger contrast corresponds to faster detection.
Use color to your advantage
When choosing color schemes, we will want mappings from data to color that are not just numerically but also perceptually uniform
Distinguish between sequential scales and categorical scales
Our eyes are optimized for perceiving the yellow/green region of the color spectrum.
Not everyone perceives color in the same way. Some individuals have colorblindness or color deficiencies.
You can take a test designed to screen for colorblindness here.
Color is context-sensitive: A and B are the same intensity and hue, but appear to be different.
Do not use rainbow color gradient schemes.
Avoid any scheme that uses green-yellow-red signaling if you have a target audience that may include colorblind people.
Be conscious of what certain colors “mean”
Which is bigger?
ggplot2
ggplot2
Aesthetics: features such as color, shape, and size that map other characteristics to structural features
ggplot2
Scales map data values to the visual values of an aesthetic
Qualitative schemes: no more than 7 colors
Can use colorRampPalette()
from the RColorBrewer package to produce larger palettes by interpolating existing ones
Quantitative schemes: use color gradient with only one hue for positive values
Quantitative schemes: use color gradient with two hues for positive and negative values. Gradient should go through a light, neutral color (white)
Small objects or thin lines need more contrast than larger areas
scale_colour_discrete
scale_colour_brewer(palette = ...)
scale_colour_gradient
(define low, high values)scale_colour_gradient2
(define low, mid, and high values)scale_fill_...
There are packages available for use that have color scheme options.
Some Examples:
There are packages such as RColorBrewer
and dichromat
that have color palettes which are aesthetically pleasing, and, in many cases, colorblind friendly.
You can also take a look at other ways to find nice color palettes.
In the diamonds
data, clarity
and cut
are ordinal, while price
and carat
are continuous.
Create a graphic that gives an overview of these four variables while respecting their types.
Discuss your graphic with a neighbor.
The movies
data set contains information from IMDB.com including ratings, genre, length in minutes, and year of release.
Explore the differences in length, rating, etc. in movie genres over time.
Hint: use faceting!
Discuss your graphic with a neighbor.