Felis silvestris catus
diff --git a/tests/testthat/test-add_phylopic.R b/tests/testthat/test-add_phylopic.R
index 447567d..79da2c6 100644
--- a/tests/testthat/test-add_phylopic.R
+++ b/tests/testthat/test-add_phylopic.R
@@ -27,15 +27,16 @@ test_that("add_phylopic works", {
angle <- runif(50, 0, 360)
hor <- sample(c(TRUE, FALSE), 50, TRUE)
ver <- sample(c(TRUE, FALSE), 50, TRUE)
- cols <- sample(c("black", "darkorange", "grey42", "white"), 50,
+ fills <- sample(c("black", "darkorange", "grey42", "white"), 50,
replace = TRUE)
+ cols <- ifelse(fills == "white", "black", NA)
alpha <- runif(50, 0, 1)
p <- ggplot(data.frame(cat.x = posx, cat.y = posy), aes(cat.x, cat.y)) +
geom_blank() +
add_phylopic(uuid = "23cd6aa4-9587-4a2e-8e26-de42885004c9",
x = posx, y = posy, ysize = sizey,
- fill = cols, alpha = alpha,
+ fill = fills, color = cols, alpha = alpha,
angle = angle, horizontal = hor, vertical = ver)
p <- p + ggtitle("R Cat Herd!!")
expect_doppelganger("phylopics on top of plot", p)
diff --git a/tests/testthat/test-add_phylopic_base.R b/tests/testthat/test-add_phylopic_base.R
index 843063b..a5d47a0 100644
--- a/tests/testthat/test-add_phylopic_base.R
+++ b/tests/testthat/test-add_phylopic_base.R
@@ -25,15 +25,16 @@ test_that("add_phylopic_base works", {
angle <- runif(50, 0, 360)
hor <- sample(c(TRUE, FALSE), 50, TRUE)
ver <- sample(c(TRUE, FALSE), 50, TRUE)
- cols <- sample(c("black", "darkorange", "grey42", "white"), 50,
- replace = TRUE)
+ fills <- sample(c("black", "darkorange", "grey42", "white"), 50,
+ replace = TRUE)
+ cols <- ifelse(fills == "white", "black", NA)
alpha <- runif(50, 0, 1)
expect_doppelganger("phylopics on top of plot", function() {
plot(posx, posy, type = "n", main = "A cat herd")
add_phylopic_base(uuid = "23cd6aa4-9587-4a2e-8e26-de42885004c9",
x = posx, y = posy, ysize = sizey,
- color = cols, alpha = alpha,
+ fill = fills, color = cols, alpha = alpha,
angle = angle,
horizontal = hor, vertical = ver)
})
diff --git a/tests/testthat/test-geom_phylopic.R b/tests/testthat/test-geom_phylopic.R
index 6b12966..152794d 100644
--- a/tests/testthat/test-geom_phylopic.R
+++ b/tests/testthat/test-geom_phylopic.R
@@ -81,7 +81,8 @@ test_that("phylopic_key_glyph works", {
aes(x = x, y = y, name = name, color = name), size = 10,
show.legend = TRUE, verbose = TRUE,
key_glyph =
- phylopic_key_glyph(uuid = "23cd6aa4-9587-4a2e-8e26-de42885004c9")
+ phylopic_key_glyph(uuid = c("23cd6aa4-9587-4a2e-8e26-de42885004c9",
+ "16cfde1b-d577-4de8-82b9-62b760aacba5"))
) +
coord_cartesian(xlim = c(1, 6), ylim = c(5, 30)) +
theme_classic(base_size = 16)
@@ -102,8 +103,10 @@ test_that("phylopic_key_glyph works", {
aes(x = x, y = y, name = name, color = name), size = 10,
show.legend = TRUE, verbose = TRUE,
key_glyph =
- phylopic_key_glyph(uuid = "23cd6aa4-9587-4a2e-8e26-de42885004c9",
- img = cat)
+ phylopic_key_glyph(
+ uuid = "23cd6aa4-9587-4a2e-8e26-de42885004c9",
+ img = cat
+ )
) +
coord_cartesian(xlim = c(1, 6), ylim = c(5, 30)) +
theme_classic(base_size = 16))
diff --git a/vignettes/a-getting-started.Rmd b/vignettes/a-getting-started.Rmd
index 856f18e..214b272 100644
--- a/vignettes/a-getting-started.Rmd
+++ b/vignettes/a-getting-started.Rmd
@@ -9,7 +9,7 @@ vignette: >
**Authors:** Lewis A. Jones & William Gearty
-**Last updated:** 2023-11-09
+**Last updated:** 2023-11-16
@@ -171,13 +171,12 @@ The `rotate_phylopic()` function can be used to rotate a silhouette an arbitrary
img_rot <- rotate_phylopic(img = img, angle = 45)
```
-Finally, the `recolor_phylopic()` function can be used to modify the color and/or transparency of a silhouette. The vast majority of PhyloPic silhouettes are black and fully opaque by default. However, it may be useful to change this when the you are trying to either match an existing visualization color palette or trying to convey extra information, such as categorical data, through color.
+Finally, the `recolor_phylopic()` function can be used to modify the fill color, outline color, and/or transparency of a silhouette. The vast majority of PhyloPic silhouettes are solid black, are fully opaque, and have a transparent outline by default. However, it may be useful to change this when the you are trying to either match an existing visualization color palette or trying to convey extra information, such as categorical data, through color.
```r
-# Change color to blue and transparency to 50%
-img_col <- recolor_phylopic(img = img, alpha = 0.5,
- color = "blue", fill = "blue")
+# Change fill color to blue and transparency to 50%
+img_col <- recolor_phylopic(img = img, alpha = 0.5, fill = "blue")
```
Let's see what those look like in the same plot:
@@ -189,7 +188,7 @@ ggplot() +
add_phylopic(img = img_flip, x = 1.25, y = 1.25, ysize = 0.25) +
add_phylopic(img = img_rot, x = 1, y = 1, ysize = 0.25) +
add_phylopic(img = img_col, x = 0.75, y = 0.75, ysize = 0.25,
- color = "original")
+ fill = "original")
```
@@ -199,7 +198,7 @@ ggplot() +
You'll notice that the rotated silhouette is smaller than the other two silhouettes. This is because our functions have arguments to specify the height (`ysize`). The width is automatically set to maintain the original aspect ratio of the silhouette. In this case, the aspect ratio of the rotated silhouette has changed, so the same height results in a smaller silhouette overall.
-For convenience, we have also included these transformation options within all of the visualization functions. The default color is "black", hence why we needed to specify `color = "original"` above. However, when the same transformed silhouette will be used for multiple visualizations, we suggest transforming the silhouette first, saving it as a new object, then using this new object for visualization purposes.
+For convenience, we have also included these transformation options within all of the visualization functions. The default fill is "black", hence why we needed to specify `fill = "original"` above. However, when the same transformed silhouette will be used for multiple visualizations, we suggest transforming the silhouette first, saving it as a new object, then using this new object for visualization purposes.
## Get attribution
Now that you've made a plot and used some silhouettes, you should acknowledge the contributors that made those silhouettes. Fortunately, **rphylopic** includes the `get_attribution()` function to get contributor data about specific images:
diff --git a/vignettes/a-getting-started.Rmd.orig b/vignettes/a-getting-started.Rmd.orig
index 20f54ae..f715f3c 100644
--- a/vignettes/a-getting-started.Rmd.orig
+++ b/vignettes/a-getting-started.Rmd.orig
@@ -135,12 +135,11 @@ The `rotate_phylopic()` function can be used to rotate a silhouette an arbitrary
img_rot <- rotate_phylopic(img = img, angle = 45)
```
-Finally, the `recolor_phylopic()` function can be used to modify the color and/or transparency of a silhouette. The vast majority of PhyloPic silhouettes are black and fully opaque by default. However, it may be useful to change this when the you are trying to either match an existing visualization color palette or trying to convey extra information, such as categorical data, through color.
+Finally, the `recolor_phylopic()` function can be used to modify the fill color, outline color, and/or transparency of a silhouette. The vast majority of PhyloPic silhouettes are solid black, are fully opaque, and have a transparent outline by default. However, it may be useful to change this when the you are trying to either match an existing visualization color palette or trying to convey extra information, such as categorical data, through color.
```{r}
-# Change color to blue and transparency to 50%
-img_col <- recolor_phylopic(img = img, alpha = 0.5,
- color = "blue", fill = "blue")
+# Change fill color to blue and transparency to 50%
+img_col <- recolor_phylopic(img = img, alpha = 0.5, fill = "blue")
```
Let's see what those look like in the same plot:
@@ -151,12 +150,12 @@ ggplot() +
add_phylopic(img = img_flip, x = 1.25, y = 1.25, ysize = 0.25) +
add_phylopic(img = img_rot, x = 1, y = 1, ysize = 0.25) +
add_phylopic(img = img_col, x = 0.75, y = 0.75, ysize = 0.25,
- color = "original")
+ fill = "original")
```
You'll notice that the rotated silhouette is smaller than the other two silhouettes. This is because our functions have arguments to specify the height (`ysize`). The width is automatically set to maintain the original aspect ratio of the silhouette. In this case, the aspect ratio of the rotated silhouette has changed, so the same height results in a smaller silhouette overall.
-For convenience, we have also included these transformation options within all of the visualization functions. The default color is "black", hence why we needed to specify `color = "original"` above. However, when the same transformed silhouette will be used for multiple visualizations, we suggest transforming the silhouette first, saving it as a new object, then using this new object for visualization purposes.
+For convenience, we have also included these transformation options within all of the visualization functions. The default fill is "black", hence why we needed to specify `fill = "original"` above. However, when the same transformed silhouette will be used for multiple visualizations, we suggest transforming the silhouette first, saving it as a new object, then using this new object for visualization purposes.
## Get attribution
Now that you've made a plot and used some silhouettes, you should acknowledge the contributors that made those silhouettes. Fortunately, **rphylopic** includes the `get_attribution()` function to get contributor data about specific images:
diff --git a/vignettes/b-advanced-ggplot.Rmd b/vignettes/b-advanced-ggplot.Rmd
index ff4bc3f..e04cb2c 100644
--- a/vignettes/b-advanced-ggplot.Rmd
+++ b/vignettes/b-advanced-ggplot.Rmd
@@ -9,7 +9,7 @@ vignette: >
**Authors:** William Gearty & Lewis A. Jones
-**Last updated:** 2023-11-09
+**Last updated:** 2023-11-16
@@ -124,19 +124,20 @@ ggplot(penguins_subset) +
plot of chunk ggplot-penguin-plot-4
-Finally, let's color the female and male penguins with different colors. Note that the default for `geom_phylopic()` is to not display a legend, so we need to set `show.legend = TRUE`. However, we only want a legend for the colors, so we use `guide = "none"` for the size scale:
+Finally, let's give the female and male penguins different fill colors. Note that the default for `geom_phylopic()` is to not display a legend, so we need to set `show.legend = TRUE`. However, we only want a legend for the fill colors, so we use `guide = "none"` for the size scale. We also want to show the fill color in the legend, so we need to override the shape:
```r
ggplot(penguins_subset) +
geom_phylopic(img = penguin_rot,
aes(x = bill_length_mm, y = flipper_length_mm,
- size = body_mass_g, color = sex),
+ size = body_mass_g, fill = sex),
show.legend = TRUE) +
labs(x = "Bill length (mm)", y = "Flipper length (mm)") +
scale_size_continuous(guide = "none") +
- scale_color_manual("Sex", values = c("orange", "blue"),
- labels = c("Female", "Male")) +
+ scale_fill_manual("Sex", values = c("orange", "blue"),
+ labels = c("Female", "Male"),
+ guide = guide_legend(override.aes = list(shape = 21))) +
facet_wrap(~species, ncol = 1) +
theme_bw(base_size = 15) +
theme(legend.position = c(0.9, 0.9))
@@ -154,12 +155,12 @@ Hmm...the colored dots in the legend are great, but lucky for us, the package al
ggplot(penguins_subset) +
geom_phylopic(img = penguin_rot,
aes(x = bill_length_mm, y = flipper_length_mm,
- size = body_mass_g, color = sex),
+ size = body_mass_g, fill = sex),
show.legend = TRUE,
key_glyph = phylopic_key_glyph(img = penguin_rot)) +
labs(x = "Bill length (mm)", y = "Flipper length (mm)") +
scale_size_continuous(guide = "none") +
- scale_color_manual("Sex", values = c("orange", "blue"),
+ scale_fill_manual("Sex", values = c("orange", "blue"),
labels = c("Female", "Male")) +
facet_wrap(~species, ncol = 1) +
theme_bw(base_size = 15) +
@@ -198,7 +199,7 @@ Then we'll subset our occurrences to only those for *Diplocaulus*:
tetrapods <- subset(tetrapods, genus == "Diplocaulus")
```
-Now, let's plot those occurrences on a world map. `{ggplot2}` and it's built-in function `map_data()` make this a breeze. Note that we use `alpha = 0.75` in case there are multiple occurrences in the same place. That way, the darker the color, the more occurrences in that geographic location.
+Now, let's plot those occurrences on a world map. `{ggplot2}` and it's built-in function `map_data()` make this a breeze. Note that we use `alpha = 0.75` in case there are multiple occurrences in the same place. That way, the darker the fill color, the more occurrences in that geographic location.
```r
@@ -209,7 +210,7 @@ world <- st_wrap_dateline(world)
ggplot(world) +
geom_sf(fill = "lightgray", color = "darkgrey", linewidth = 0.1) +
geom_point(data = tetrapods, aes(x = lng, y = lat),
- size = 4, alpha = 0.75, color = "blue") +
+ size = 4, alpha = 0.75, fill = "blue") +
theme_void() +
coord_sf()
```
@@ -226,7 +227,7 @@ Now, as with the penguin figure above, we can easily replace those points with s
ggplot(world) +
geom_sf(fill = "lightgray", color = "darkgrey", linewidth = 0.1) +
geom_phylopic(data = tetrapods, aes(x = lng, y = lat, name = genus),
- size = 4, alpha = 0.75, color = "blue") +
+ size = 4, alpha = 0.75, fill = "blue") +
theme_void() +
coord_sf()
```
@@ -250,7 +251,7 @@ bbox <- st_graticule(crs = st_crs("ESRI:54030"),
ggplot(world) +
geom_sf(fill = "lightgray", color = "darkgrey", linewidth = 0.1) +
geom_phylopic(data = tetrapods, aes(x = lng, y = lat, name = genus),
- size = 4E5, alpha = 0.75, color = "blue") +
+ size = 4E5, alpha = 0.75, fill = "blue") +
geom_sf(data = bbox) +
theme_void() +
coord_sf(default_crs = st_crs(4326), crs = st_crs("ESRI:54030"))
diff --git a/vignettes/b-advanced-ggplot.Rmd.orig b/vignettes/b-advanced-ggplot.Rmd.orig
index aee3b95..ef31a81 100644
--- a/vignettes/b-advanced-ggplot.Rmd.orig
+++ b/vignettes/b-advanced-ggplot.Rmd.orig
@@ -103,18 +103,19 @@ ggplot(penguins_subset) +
theme_bw(base_size = 15)
```
-Finally, let's color the female and male penguins with different colors. Note that the default for `geom_phylopic()` is to not display a legend, so we need to set `show.legend = TRUE`. However, we only want a legend for the colors, so we use `guide = "none"` for the size scale:
+Finally, let's give the female and male penguins different fill colors. Note that the default for `geom_phylopic()` is to not display a legend, so we need to set `show.legend = TRUE`. However, we only want a legend for the fill colors, so we use `guide = "none"` for the size scale. We also want to show the fill color in the legend, so we need to override the shape:
```{r ggplot-penguin-plot-5}
ggplot(penguins_subset) +
geom_phylopic(img = penguin_rot,
aes(x = bill_length_mm, y = flipper_length_mm,
- size = body_mass_g, color = sex),
+ size = body_mass_g, fill = sex),
show.legend = TRUE) +
labs(x = "Bill length (mm)", y = "Flipper length (mm)") +
scale_size_continuous(guide = "none") +
- scale_color_manual("Sex", values = c("orange", "blue"),
- labels = c("Female", "Male")) +
+ scale_fill_manual("Sex", values = c("orange", "blue"),
+ labels = c("Female", "Male"),
+ guide = guide_legend(override.aes = list(shape = 21))) +
facet_wrap(~species, ncol = 1) +
theme_bw(base_size = 15) +
theme(legend.position = c(0.9, 0.9))
@@ -126,12 +127,12 @@ Hmm...the colored dots in the legend are great, but lucky for us, the package al
ggplot(penguins_subset) +
geom_phylopic(img = penguin_rot,
aes(x = bill_length_mm, y = flipper_length_mm,
- size = body_mass_g, color = sex),
+ size = body_mass_g, fill = sex),
show.legend = TRUE,
key_glyph = phylopic_key_glyph(img = penguin_rot)) +
labs(x = "Bill length (mm)", y = "Flipper length (mm)") +
scale_size_continuous(guide = "none") +
- scale_color_manual("Sex", values = c("orange", "blue"),
+ scale_fill_manual("Sex", values = c("orange", "blue"),
labels = c("Female", "Male")) +
facet_wrap(~species, ncol = 1) +
theme_bw(base_size = 15) +
@@ -163,7 +164,7 @@ Then we'll subset our occurrences to only those for *Diplocaulus*:
tetrapods <- subset(tetrapods, genus == "Diplocaulus")
```
-Now, let's plot those occurrences on a world map. `{ggplot2}` and it's built-in function `map_data()` make this a breeze. Note that we use `alpha = 0.75` in case there are multiple occurrences in the same place. That way, the darker the color, the more occurrences in that geographic location.
+Now, let's plot those occurrences on a world map. `{ggplot2}` and it's built-in function `map_data()` make this a breeze. Note that we use `alpha = 0.75` in case there are multiple occurrences in the same place. That way, the darker the fill color, the more occurrences in that geographic location.
```{r ggplot-geog-plot-1, fig.height = 3.5}
# Get map data
@@ -173,7 +174,7 @@ world <- st_wrap_dateline(world)
ggplot(world) +
geom_sf(fill = "lightgray", color = "darkgrey", linewidth = 0.1) +
geom_point(data = tetrapods, aes(x = lng, y = lat),
- size = 4, alpha = 0.75, color = "blue") +
+ size = 4, alpha = 0.75, fill = "blue") +
theme_void() +
coord_sf()
```
@@ -184,7 +185,7 @@ Now, as with the penguin figure above, we can easily replace those points with s
ggplot(world) +
geom_sf(fill = "lightgray", color = "darkgrey", linewidth = 0.1) +
geom_phylopic(data = tetrapods, aes(x = lng, y = lat, name = genus),
- size = 4, alpha = 0.75, color = "blue") +
+ size = 4, alpha = 0.75, fill = "blue") +
theme_void() +
coord_sf()
```
@@ -202,7 +203,7 @@ bbox <- st_graticule(crs = st_crs("ESRI:54030"),
ggplot(world) +
geom_sf(fill = "lightgray", color = "darkgrey", linewidth = 0.1) +
geom_phylopic(data = tetrapods, aes(x = lng, y = lat, name = genus),
- size = 4E5, alpha = 0.75, color = "blue") +
+ size = 4E5, alpha = 0.75, fill = "blue") +
geom_sf(data = bbox) +
theme_void() +
coord_sf(default_crs = st_crs(4326), crs = st_crs("ESRI:54030"))
diff --git a/vignettes/base-geog-plot-1-1.png b/vignettes/base-geog-plot-1-1.png
index e4d5cab..f3bc3e2 100644
Binary files a/vignettes/base-geog-plot-1-1.png and b/vignettes/base-geog-plot-1-1.png differ
diff --git a/vignettes/base-geog-plot-2-1.png b/vignettes/base-geog-plot-2-1.png
index 2e9ca68..d40d6ef 100644
Binary files a/vignettes/base-geog-plot-2-1.png and b/vignettes/base-geog-plot-2-1.png differ
diff --git a/vignettes/base-penguin-plot-2-1.png b/vignettes/base-penguin-plot-2-1.png
index 97ce8a9..035f975 100644
Binary files a/vignettes/base-penguin-plot-2-1.png and b/vignettes/base-penguin-plot-2-1.png differ
diff --git a/vignettes/base-penguin-plot-3-1.png b/vignettes/base-penguin-plot-3-1.png
index c6e411d..d18dd45 100644
Binary files a/vignettes/base-penguin-plot-3-1.png and b/vignettes/base-penguin-plot-3-1.png differ
diff --git a/vignettes/base-penguin-plot-4-1.png b/vignettes/base-penguin-plot-4-1.png
index a0da8a2..40ae53d 100644
Binary files a/vignettes/base-penguin-plot-4-1.png and b/vignettes/base-penguin-plot-4-1.png differ
diff --git a/vignettes/base-penguin-plot-5-1.png b/vignettes/base-penguin-plot-5-1.png
index 1695733..05ee631 100644
Binary files a/vignettes/base-penguin-plot-5-1.png and b/vignettes/base-penguin-plot-5-1.png differ
diff --git a/vignettes/base-phylo-plot-3-1.png b/vignettes/base-phylo-plot-3-1.png
index a3f2004..a77a4a7 100644
Binary files a/vignettes/base-phylo-plot-3-1.png and b/vignettes/base-phylo-plot-3-1.png differ
diff --git a/vignettes/base-phylo-plot-4-1.png b/vignettes/base-phylo-plot-4-1.png
index 4faad04..1683911 100644
Binary files a/vignettes/base-phylo-plot-4-1.png and b/vignettes/base-phylo-plot-4-1.png differ
diff --git a/vignettes/c-advanced-base.Rmd b/vignettes/c-advanced-base.Rmd
index aa2e7c0..4108bdb 100644
--- a/vignettes/c-advanced-base.Rmd
+++ b/vignettes/c-advanced-base.Rmd
@@ -9,7 +9,7 @@ vignette: >
**Authors:** William Gearty & Lewis A. Jones
-**Last updated:** 2023-11-09
+**Last updated:** 2023-11-16
@@ -159,7 +159,7 @@ for (i in seq_along(species_split)) {
plot of chunk base-penguin-plot-4
-Finally, let's color the female and male penguins with different colors. We'll also add a legend to the last panel.
+Finally, let's give the female and male penguins different fill colors. We'll also add a legend to the last panel.
```r
@@ -176,7 +176,7 @@ for (i in seq_along(species_split)) {
y = species_data$flipper_length_mm,
ysize = species_data$body_mass_g /
max(penguins_subset$body_mass_g, na.rm = TRUE) * 8,
- color = ifelse(species_data$sex == "male", "blue", "orange"))
+ fill = ifelse(species_data$sex == "male", "blue", "orange"))
}
# Add a legend to the last plot
@@ -192,7 +192,7 @@ legend("bottomright", legend = c("Female", "Male"), pch = 20,
Now that's a nice figure!
# Geographic distribution
-In much the same way as generic x-y plotting, the **rphylopic** package can be used in base R to plot organism silhouettes on a map. That is, to plot data points (e.g., species occurrences) as silhouettes. We provide an example here of how this might be achieved. For this application, we use the example occurrence dataset of early (Carboniferous to Early Triassic) tetrapods from the `{palaeoverse}` R package to visualize the geographic distribution of *Mesosaurus* fossils.
+In much the same way as generic x-y plotting, the **rphylopic** package can be used in base R to plot organism silhouettes on a map. That is, to plot data points (e.g., species occurrences) as silhouettes. We provide an example here of how this might be achieved. For this application, we use the example occurrence dataset of early (Carboniferous to Early Triassic) tetrapods from the `{palaeoverse}` R package to visualize the geographic distribution of *Diplocaulus* fossils.
First, let's load our libraries and the tetrapod data:
@@ -206,12 +206,12 @@ library(palaeoverse)
data(tetrapods)
```
-Then we'll subset our occurrences to only those for *Mesosaurus*:
+Then we'll subset our occurrences to only those for *Diplocaulus*:
```r
# Subset to desired group
-tetrapods <- subset(tetrapods, genus == "Mesosaurus")
+tetrapods <- subset(tetrapods, genus == "Diplocaulus")
```
Now, let's plot those occurrences on a world map. Here we use the `{geodata}` and `{raster}` packages to generate the map. Then we add colored points on top of this. Note that we use `alpha = 0.75` in case there are multiple occurrences in the same place. That way, the darker the color, the more occurrences in that geographic location.
@@ -235,8 +235,8 @@ Now, as with the penguin figure above, we can easily replace those points with s
```r
map("world", col = "lightgrey", fill = TRUE)
-add_phylopic_base(name = "Mesosaurus", x = tetrapods$lng, y = tetrapods$lat,
- ysize = 8, color = "blue", alpha = 0.75)
+add_phylopic_base(name = "Diplocaulus", x = tetrapods$lng, y = tetrapods$lat,
+ ysize = 8, fill = "blue", alpha = 0.75)
```
diff --git a/vignettes/c-advanced-base.Rmd.orig b/vignettes/c-advanced-base.Rmd.orig
index 4d18bec..47d432e 100644
--- a/vignettes/c-advanced-base.Rmd.orig
+++ b/vignettes/c-advanced-base.Rmd.orig
@@ -137,7 +137,7 @@ for (i in seq_along(species_split)) {
}
```
-Finally, let's color the female and male penguins with different colors. We'll also add a legend to the last panel.
+Finally, let's give the female and male penguins different fill colors. We'll also add a legend to the last panel.
```{r base-penguin-plot-5}
par(mfrow = c(3, 1), mar = c(4, 4, 2, 1))
@@ -153,7 +153,7 @@ for (i in seq_along(species_split)) {
y = species_data$flipper_length_mm,
ysize = species_data$body_mass_g /
max(penguins_subset$body_mass_g, na.rm = TRUE) * 8,
- color = ifelse(species_data$sex == "male", "blue", "orange"))
+ fill = ifelse(species_data$sex == "male", "blue", "orange"))
}
# Add a legend to the last plot
@@ -164,7 +164,7 @@ legend("bottomright", legend = c("Female", "Male"), pch = 20,
Now that's a nice figure!
# Geographic distribution
-In much the same way as generic x-y plotting, the **rphylopic** package can be used in base R to plot organism silhouettes on a map. That is, to plot data points (e.g., species occurrences) as silhouettes. We provide an example here of how this might be achieved. For this application, we use the example occurrence dataset of early (Carboniferous to Early Triassic) tetrapods from the `{palaeoverse}` R package to visualize the geographic distribution of *Mesosaurus* fossils.
+In much the same way as generic x-y plotting, the **rphylopic** package can be used in base R to plot organism silhouettes on a map. That is, to plot data points (e.g., species occurrences) as silhouettes. We provide an example here of how this might be achieved. For this application, we use the example occurrence dataset of early (Carboniferous to Early Triassic) tetrapods from the `{palaeoverse}` R package to visualize the geographic distribution of *Diplocaulus* fossils.
First, let's load our libraries and the tetrapod data:
@@ -177,11 +177,11 @@ library(palaeoverse)
data(tetrapods)
```
-Then we'll subset our occurrences to only those for *Mesosaurus*:
+Then we'll subset our occurrences to only those for *Diplocaulus*:
```{r}
# Subset to desired group
-tetrapods <- subset(tetrapods, genus == "Mesosaurus")
+tetrapods <- subset(tetrapods, genus == "Diplocaulus")
```
Now, let's plot those occurrences on a world map. Here we use the `{geodata}` and `{raster}` packages to generate the map. Then we add colored points on top of this. Note that we use `alpha = 0.75` in case there are multiple occurrences in the same place. That way, the darker the color, the more occurrences in that geographic location.
@@ -198,8 +198,8 @@ Now, as with the penguin figure above, we can easily replace those points with s
```{r base-geog-plot-2, fig.height = 5, warning = FALSE}
map("world", col = "lightgrey", fill = TRUE)
-add_phylopic_base(name = "Mesosaurus", x = tetrapods$lng, y = tetrapods$lat,
- ysize = 8, color = "blue", alpha = 0.75)
+add_phylopic_base(name = "Diplocaulus", x = tetrapods$lng, y = tetrapods$lat,
+ ysize = 8, fill = "blue", alpha = 0.75)
```
Snazzy!
diff --git a/vignettes/ggplot-geog-plot-1-1.png b/vignettes/ggplot-geog-plot-1-1.png
index 93f3dd6..04a1be9 100644
Binary files a/vignettes/ggplot-geog-plot-1-1.png and b/vignettes/ggplot-geog-plot-1-1.png differ
diff --git a/vignettes/ggplot-geog-plot-2-1.png b/vignettes/ggplot-geog-plot-2-1.png
index 236ec78..dc4a46f 100644
Binary files a/vignettes/ggplot-geog-plot-2-1.png and b/vignettes/ggplot-geog-plot-2-1.png differ
diff --git a/vignettes/ggplot-geog-plot-3-1.png b/vignettes/ggplot-geog-plot-3-1.png
index 605d54f..48375a1 100644
Binary files a/vignettes/ggplot-geog-plot-3-1.png and b/vignettes/ggplot-geog-plot-3-1.png differ
diff --git a/vignettes/ggplot-penguin-plot-2-1.png b/vignettes/ggplot-penguin-plot-2-1.png
index f23a023..090d899 100644
Binary files a/vignettes/ggplot-penguin-plot-2-1.png and b/vignettes/ggplot-penguin-plot-2-1.png differ
diff --git a/vignettes/ggplot-penguin-plot-3-1.png b/vignettes/ggplot-penguin-plot-3-1.png
index 6300b66..21e5aaa 100644
Binary files a/vignettes/ggplot-penguin-plot-3-1.png and b/vignettes/ggplot-penguin-plot-3-1.png differ
diff --git a/vignettes/ggplot-penguin-plot-4-1.png b/vignettes/ggplot-penguin-plot-4-1.png
index 3cb2017..4cd56bc 100644
Binary files a/vignettes/ggplot-penguin-plot-4-1.png and b/vignettes/ggplot-penguin-plot-4-1.png differ
diff --git a/vignettes/ggplot-penguin-plot-5-1.png b/vignettes/ggplot-penguin-plot-5-1.png
index 4a9eb80..c691998 100644
Binary files a/vignettes/ggplot-penguin-plot-5-1.png and b/vignettes/ggplot-penguin-plot-5-1.png differ
diff --git a/vignettes/ggplot-penguin-plot-6-1.png b/vignettes/ggplot-penguin-plot-6-1.png
index 89f5b3d..ea298c5 100644
Binary files a/vignettes/ggplot-penguin-plot-6-1.png and b/vignettes/ggplot-penguin-plot-6-1.png differ
diff --git a/vignettes/ggplot-phylo-plot-3-1.png b/vignettes/ggplot-phylo-plot-3-1.png
index 0c6f062..865490f 100644
Binary files a/vignettes/ggplot-phylo-plot-3-1.png and b/vignettes/ggplot-phylo-plot-3-1.png differ
diff --git a/vignettes/ggplot-phylo-plot-4-1.png b/vignettes/ggplot-phylo-plot-4-1.png
index a0804a9..da76011 100644
Binary files a/vignettes/ggplot-phylo-plot-4-1.png and b/vignettes/ggplot-phylo-plot-4-1.png differ
diff --git a/vignettes/intro-base-plot-1.png b/vignettes/intro-base-plot-1.png
index 5183f92..a0a8ccf 100644
Binary files a/vignettes/intro-base-plot-1.png and b/vignettes/intro-base-plot-1.png differ
diff --git a/vignettes/intro-ggplot-plot-1.png b/vignettes/intro-ggplot-plot-1.png
index 2726bb9..8f94660 100644
Binary files a/vignettes/intro-ggplot-plot-1.png and b/vignettes/intro-ggplot-plot-1.png differ
diff --git a/vignettes/intro-transform-plot-1.png b/vignettes/intro-transform-plot-1.png
index 68061c5..04e5ab5 100644
Binary files a/vignettes/intro-transform-plot-1.png and b/vignettes/intro-transform-plot-1.png differ