From 205b70c0678462df1e91a6fec804ce73512898b6 Mon Sep 17 00:00:00 2001 From: hpolvech <helene.polveche@ens-lyon.fr> Date: Thu, 14 Oct 2021 09:06:42 +0200 Subject: [PATCH] solution1 --- session_4/session_4.Rmd | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/session_4/session_4.Rmd b/session_4/session_4.Rmd index a899926..5c71bda 100644 --- a/session_4/session_4.Rmd +++ b/session_4/session_4.Rmd @@ -434,7 +434,22 @@ library(viridis) Using `mpg` and the 'ggplot2' package, reproduce the graph studied in session 2, 3.1: color mapping. Modify the colors representing the class of cars with the palettes `Dark2` of [RColorBrewer](https://www.datanovia.com/en/fr/blog/palette-de-couleurs-rcolorbrewer-de-a-a-z/), then `MononokeMedium` from [Ghibli](https://github.com/ewenme/ghibli). +<details><summary>Solution</summary> + <p> + ```{r mpg_color1} +ggplot(data = mpg, mapping = aes(x = displ, y = hwy, color = class)) + + geom_point() + + scale_color_brewer(palette = "Dark2") +``` +```{r mpg_color2} +ggplot(data = mpg, mapping = aes(x = displ, y = hwy, color = class)) + + geom_point() + + scale_colour_ghibli_d("MononokeMedium") +``` + </p> +</details> + -- GitLab