Illegible axis labels

Viewed 53

I have R plots but way too many values are shown on the y axis and the labels are illegible. How can I reduce the number of labels on the axis?

Here is the code :

df$ID <- paste(df$Country, df$Specie, sep = "_")
df_list <- split(df, df$ID)
lapply(names(df_list), function(x) {
    p <- ggplot(df_list[[x]], aes(x = Month_Yr, y = median, group = Specie, color = Specie)) +
        geom_line() +
        geom_point()
    ggsave(paste0(x, "_plot.png"), plot = p)
})

here is my dataframe, and I have over 4000 rows

    Date     Country    Specie median   Month_Yr     ID
1   2019-06-01  AE  dew         15.5    2019-06 AE_dew
2   2019-06-01  AE  humidity    36.5    2019-06 AE_humidity
3   2019-06-01  AE  o3          12.85   2019-06 AE_o3
4   2019-06-01  AE  pm25        138.0   2019-06 AE_pm25
5   2019-06-01  AE  pressure    1003.5  2019-06 AE_pressure

This is what most of the plots look like:

enter image description here

0 Answers
Related