BioDivHealth / Template_Repo

A proposed repository design for projects
MIT License
0 stars 0 forks source link

Example Issue: Requesting help on a plot - how do I change the shape of points on a plot? #1

Open EliseGallois opened 9 months ago

EliseGallois commented 9 months ago

Hi all,

I am requesting help on this script: https://github.com/BioDivHealth/Template_Repo/blob/main/scripts/01_Data_Exploration.R

I would like to change the shape of the points in my scatterplot from circle to triangle. Would anyone be able to help? Here is my current code:

(iris_scatter <- ggplot(datasets::iris) + aes(x = Sepal.Length, y = Sepal.Width, colour = Species) + geom_point(shape = "circle", size = 3, alpha = 0.5) + scale_color_viridis_d(option = "viridis", direction = 1) + labs(x = "Sepal Length (mm)", y = "Sepal Width (mm)", color = "Species") + theme_classic())

01_iris_scatter

EliseGallois commented 9 months ago

Then, you can answer questions on here like a normal forum post! For example, here is me resolving my own issue:

(iris_scatter <- ggplot(datasets::iris) + aes(x = Sepal.Length, y = Sepal.Width, colour = Species) + geom_point(shape = "triangle", size = 3, alpha = 0.5) + scale_color_viridis_d(option = "viridis", direction = 1) + labs(x = "Sepal Length (mm)", y = "Sepal Width (mm)", color = "Species") + theme_classic())