简体   繁体   中英

How to add axis labels for individual entries in the Y-axis using plot() in R

I am plotting a series of time intervals against a character vector of a length of 130. Currently, the y-axis labels are numbered from 0-120 by 20s.

Is there a way to replace the numbered y-axis labels with text labels that show what variety corresponds to what time interval?

Here is an image of the plot I'm describing as it currently is:

1

You can plot without the labels and then add your custom labels.

plot(1:3,  yaxt = "n")
axis(side = 2, at = 1:3, labels = c("a","b", "c"))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM