df<-age_limbset
df$limbset<-as.factor(df$limbset)
limb_splot<-ggplot(df, aes(x=age,y=score))
limb_splot +
geom_point(aes(color = limbset, shape = limbset))+
geom_smooth(aes(color = limbset),
method = loess, se = FALSE, fullrange = TRUE)+
scale_color_manual(values = c("blue","hotpink"))+
scale_fill_manual(values = c("blue","hotpink"))+
ggpubr::stat_cor(aes(color = limbset),method="spearman", label.x = 3)+
labs(x="Age (years)",y="Total proprioception score (0-4)")+
scale_y_continuous(breaks=seq(0,4,0.5))+
scale_x_continuous(breaks=seq(2,16,2))+
theme_bw()
Sorry I do not know how to enter data here. I have created this scatterplot showing relationship between age and proprioception of both forelimbs and hindlimbs. The plot is listening to my instruction for the x axis limits and breaks, but I can only get it to listen to either the limits OR the breaks for the y axis. What am I doing wrong? How can I change the symbols for the data points? Ideally I would like them all to be dots. I would also like to change the legend name and labels to start with a capital letter.
Here's an example of a reproducible example which also addresses your questions, e.g. with scale_shape_manual
to get the shapes you want which you could choose here.
library(tidyverse)
tibble(years = rep(seq(2, 16, 1), 2),
score = abs(rnorm(30, 10, 10)),
set = rep(c("fore", "hind"), 15)
) |>
ggplot(aes(years, score, shape = set, colour = set)) +
geom_point() +
scale_shape_manual(values = c(1, 10)) +
scale_y_continuous(limits = c(0, 40), breaks = seq(0, 40, 5)) +
labs(x = "Years", y = "Score", shape = "Set", colour = "Set")
Created on 2022-05-04 by the reprex package (v2.0.1)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With