An intro to data visualization
by William Gearty
Presented at the
North American Paleontological Convention 2024
10 - 10:15 AM: Theory of data visualization
10:15 - 10:45 AM: Practical data visualization
The representation of data through the use of graphs and figures.
Often the data is complex, but the representation should be approachable and easy-to-understand.
Color
Type (aka font)
Positioning (R takes care of most of this)
Names (see cheat sheet)
HEX codes
The more color contrast the better!
Tahoma
Calibri
Helvetica
Arial
Find more at Google Fonts
sysfonts
packageRaster | Vector |
---|---|
Scale-dependent | Not scale-dependent |
Large size files | Smaller size files |
Not easily editable | Easily editable |
Can have lots of detail | Usually fewer details/textures |
Can not be converted easily to vector files | Can easily be converted to raster files |
(e.g., made in Photoshop) | (e.g., made in Illustrator) |
You can export plots from R in many file formats (we’ll mostly use ggsave()
):
File format | Image type | Notes |
---|---|---|
.jpg | Raster | Can’t have transparent parts |
.png | Raster | Can also have transparent parts |
.svg | Vector | Can edit in Inkscape/Illustrator |
Vector | Not actually an image file type, but can be used |
plot()
barplot()
hist()
boxplot()
axis()
legend()
lines()
, segments()
, rect()
, text()
, etc.{plotrix}
{rgl}
: for 3D interactive graphics{gplots}
{scatterplot3d}
: 3D scatterplots{palaeoverse}!
{lattice}
: trellis graphics{vcd}
: for categorical data{ggplot2}
: “grammar of graphics”{hexbin}
: hexagonal bins{patchwork}
: combine (ggplot2) plots{deeptime}!
{sf}
: basic objects and methods for vector data{terra}
: basic objects and methods for raster data{ggplot2}
: works for plotting spatial data, too{raster}
: plotting raster data