I am trying to set the axis limits on a geom_line()
plot made with R/ggplot2
.
Below I report the simple code:
Graph <- ggplot(data=Test,aes(x=Enc1,y=N,group=Trial,colour=Trial)) +
geom_line(size = 1) +
coord_cartesian(xlim = c(0, 100), ylim = c(0, 7)) +
scale_color_manual(values=c('#f92410','#644196')) +
ggtitle("Valutazione peel su provino 50 mm") +
theme_bw() +
theme(plot.title = element_text(hjust = 0.5)) +
xlab('Allungamento (mm)') +
ylab('Forza (N)')
Graph
My question is why the axis don't start from the origin but a little below? I would like to see the line starting directly from the bottom/left corner of the graph, but it doesn't.
Is there any way to adjust this distance? If you like I can also upload the original spreadsheet data file, but I do not know how to do.
Thank you in advance for every reply.