👩🏻💻 Emi Tanaka @ Monash University
28th November 2022 Australasian Applied Statistics Conference 2022
scale_x_continuous()
, scale_fill_discrete()
, scale_y_log10()
and so on.scale_*
, guide_*
within guides
or other handy functions (e.g. labs
, xlab
, ylab
, and so on).library(palmerpenguins)
ggplot(penguins,
aes(x = bill_depth_mm,
y = bill_length_mm,
color = flipper_length_mm,
shape = species,
size = body_mass_g)) +
geom_point() +
guides(
x = guide_axis(position = "top"),
y = guide_axis(angle = 30),
color = guide_colorsteps(order = 1),
shape = guide_legend(title.position = "bottom"),
size = guide_bins(title = "body mass")
)
scales
package.log10
format with breaks defined at 0, 10, 100, 1000, and 4000.guide = "none"
in the associated scale.Zeileis, Fisher, Hornik, Ihaka, McWhite, Murrell, Stauffer, Wilke (2019). colorspace: A Toolbox for Manipulating and Assessing Colors and Palettes. arXiv 1903.06490
Zeileis, Hornik, Murrell (2009). Escaping RGBland: Selecting Colors for Statistical Graphics. Computational Statistics & Data Analysis 53(9) 3259-3270
Made for screen projection
Made for human visual system
colorspace
📦hcl_wizard
Choose your palette > Export > R > Copy the command
scale_
Combining with ggplot
:
Colorblindness affect roughly 1 in 8 men.
Check your color choices using the colorblindr
package or otherwise.
scale_
functions or guide_
functions within guides()
.Your turn!
30:00
>
Go to emitanaka.org/dataviz-workshop/exercises/
>
Click Exercise 5