0

There are 2 different regression lines for my two variables, one line that represents 1000 light energy, and the second line representing 1500 light energy. Using geom_point I made the two lines have circle data points and black borders around them. I am trying to keep one line like this (1000 light energy), and the other (1500 light energy) to have square data points along its line.

AvsCa <- read.csv("AvsCa.csv")
ggplot(data = AvsCa, aes(x = Ca, y = A, group = Light_Level, color = Light_Level))+
  geom_point(size=2)+
  geom_point(shape =21, colour = "black", size = 2.15, stroke= 1)+
  geom_line()+
  labs(y=expression("CO"["2"]*~"Assimilation Rate"~italic(A)~"(µmol"~~m^-2*s^-1*")"), x=expression("Ambient CO"["2"]*~"Concentration, C"["a"]*~"(µmol mol"^-1*")"))+
  scale_y_continuous(sec.axis=dup_axis())+
  theme_set(theme_bw())+
  theme(axis.text = element_text(size = 11),
        axis.ticks.length=unit(-0.1, "cm"), 
        axis.text.x.top=element_blank(),
        axis.text.y.right=element_blank(),
        #makes x-axis every other tick mark text invisible
        axis.text.x.bottom = element_text(color=c(1,0,1,0)),
        axis.title.x.top=element_blank(),
        axis.title.x = element_text(margin = unit(c(5, 0, 0, 0), "mm")),
        axis.title.y.right=element_blank(),
        axis.title.y = element_text(margin = unit(c(0, 5, 0, 0), "mm")),
        panel.grid.major = element_blank(), 
        panel.grid.minor = element_blank(), 
        legend.position = c(.2,.8))+ 
        scale_color_discrete(name= expression(italic(Q["in"])~"(Light Intensity)"),
        labels=c(expression("1000 µmol m"^-2*s^-1), expression("1500 µmol m"^-2*s^-1)))+
        scale_x_continuous(limits = ~ c(min(0), max(2250)), breaks=c(0,250,500,750,1000,1250,1500,1750,2000))
glennca
  • 11
  • 1
  • 1
    Sample data, please. Refs: https://stackoverflow.com/q/5963269, [mcve], and https://stackoverflow.com/tags/r/info – r2evans May 29 '22 at 23:06
  • Try with `geom_point(aes(shape = Light_Level), colour = "black", size = 2.15, stroke= 1) + scale_shape_manual(values = c(21, 22))`. – stefan May 30 '22 at 06:48

0 Answers0