Dear R-experts,
I have the following dataset “df” (I couldn’t find an option to upload it here, otherwise I would surely do it).
My plot is:
plot <- ggplot(data=df, aes(x=date, y = urban, colour = inst)) + geom_point(aes(x=date,
y = mean_figure6, colour=as.factor(inst)), size=6) +
geom_line(aes(x=date,
y = mean_figure6, colour=as.factor(inst)), size=2) +
geom_smooth(se = FALSE, method = lm, linetype="dashed")
I am currently struggling on two (silly) difficulties:
First, I want X-axis to display all values of "date" (it does not show 1300, 1500, 1700, 1750 and 1850 on the plot above);
Second, on the X-axis the difference between 1000 and 1200 is wider than it is between 1200 and 1300, or between 1700 and 1750 (because "date" is numeric). I want X-axis to have equal distance between all 10 values of "date".
I have found one suggestion in the Internet about doing it, which unfortunately did not work:
scale_x_continuous("date", labels = as.character(date), breaks = date)
Guys, could you please help me out?