(The images are too be because of my 3k screen, sorry about that)
I've made a plot like below:
For some reasons, I need my ticks on y-axis to start from 0, but omit all ticks in the range from 0 to 40 in the upper one, and start from 0, omit all ticks in the range from 0 to 0.5 in the lower one
For example:
I don't know how to tweak my code in ggplot2, can anyone help?
Here is my code if needed:
ggthemr('fresh', layout = 'scientific',
spacing = 1, type = 'inner', line_weight = 0.6,
)
ggplot(tmb, aes(invasion, mean, color = sediment, linetype = nitrogen)) +
geom_ribbon(
aes(ymin = mean - standard.error, ymax = mean + standard.error, `group = pair),`
alpha = 0.3,
color = NA,
fill = "gray"
) +
geom_line(size = 1) +
geom_point(show.legend = TRUE) +
facet_wrap(~type, scales = "free_y", ncol = 1, strip.position = "left") +
scale_x_discrete(breaks = NULL, expand = c(0, 0.10)) +
scale_color_discrete("Sediment",
labels = c("No", "Yes")
) +
scale_linetype_discrete("Nitrogen",
labels = c("No", "Yes")
) +
theme(legend.position = "bottom",
legend.title = element_text(size = 14),
legend.key.size = unit(2.5, "lines"),
legend.text = element_text(size = 14),
panel.spacing.x = unit(0.5, "lines"),
panel.spacing.y = unit(0.5, "lines"),
axis.text = element_text(size = 14),
strip.text.x = element_text(size = 10),
strip.text.y = element_text(size = 18, margin = margin(0, 0, 0, 5)),
strip.placement = "outside",
axis.title.y = element_text(size = 18),
axis.title.x = element_text(size = 18),
aspect.ratio = 1 / 1) +
xlab("From not invaded to invaded") +
ylab(NULL)
Many thanks.