My graph looks like this:
The code I use is this
graph_substrat <- ggplot(substrat_long, aes(x=substrat,y=value,
+ group=variable, linetype=variable)) + geom_line() + ylab("Suitability Index")
+ xlab("Substrat") + background_grid(major = "xy", minor = "none")
graph_substrat <- graph_substrat + theme(legend.position="none")
I only want to plot the line between Cobble and Sand, and delete the free space in the beginning and end of the graph, so that the lines start at the Y-axis (or at least very close to it, and ends with the the last tick on the X-axis).
I tried it with limits
, expand
and coord_cartesian
, but it did not work.
Note that X is of type factor
and not numeric
.