I was wondering if anyone knew why this is happening. Here is a quick example of the code and screenshots.
library(ggplot2)
iris$randomratio <- iris$Sepal.Length/iris$Sepal.Width
plot_iris <- ggplot(iris, aes(x=Sepal.Length, y=Sepal.Width, color = Species)) +
geom_point() +
theme_light() +
ggrepel::geom_text_repel(data=subset(iris, randomratio > 2.7),
aes(Sepal.Length, Sepal.Width, label= Species))
plot_iris
cowplot::plot_grid(plot_iris, plot_iris, label = c('A', 'B'))
Now when I do this in an RMD file I get the points labelled that I want (right) But when I try to do this in the Rstudio notebook output I get the following:
NB It doesn't work with ggplot or cowplot. With cowplot it doesn't work in the regular file as well.
Does anyone know how I can fix this?