I have created this plot using ggplot in R and am struggling to get a polished finish:
I exported the file as a JPEG and PNG and it always seems a little pixelated, especially the black circle, is there an easy way to fix this? I would also like to add horizontal lines on the error bars.
Here is the code I used:
library(ggplot2)
theme_set(
theme_classic() )
df <- rdata2
df$SITE <- as.factor(df$SITE)
library(dplyr)
df.summary <- df %>%
group_by(SITE) %>%
summarise(
sd = sd(CF, na.rm = TRUE),
CF = mean(CF)
)
df.summary
f <- ggplot(
df.summary,
aes(x = SITE, y = CF, ymin = CF-sd, ymax = CF+sd)
)
ff<- f + geom_pointrange()
ff
ggplot(df, aes(SITE, CF))+
geom_jitter(position = position_jitter(0.2), color = "darkgray") +
geom_pointrange(aes(ymin = CF-sd, ymax = CF+sd),data = df.summary)+labs(title="",x="Where",y = "Condition")
