简体   繁体   中英

Title / head above plot in R

I made a time plot in R, but now I want to set a title "Phase 4" above the plot. I already tried with "head="Phase 4" and "title = Phase 4" but this didn't work

 library("extrafont")
 plot <- ts.plot(newdata, col=1:5)
 print(plot)
 dev.copy2pdf(file="C:/Users/X/Desktop/timeplot_fase4.pdf",height=3, 
 width=4,title="Phase 4", family="CM Roman",pointsize=12);
 dev.off ();

Someone who knows how I can do this?

您可以在绘图语句中添加标题。

plot <- ts.plot(newdata, col=1:5, main="Phase 4")

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