LoginSignup
2

More than 5 years have passed since last update.

plotで軸タイトルを縦書きにする

Posted at

当方windows環境です。
plotを用いる際に軸タイトルを縦書きにしたいと聞かれたのでとりあえず改行コードを間にはさむ回答をしたのですが、ggplot2やlatticeを用いる以外にもっとエレガントな回答ないでしょうか。

axis_text.R
convertTXT <- function(x){
res <- paste(collapse="\n", unlist(strsplit(split="", x)))
return(res)
}

plot(x=2000:2010, y=25:35, type="p", xlab="平均気温", ylab="")
mtext(convertTXT("全世界の海賊の数"), side=2, las=1, line=3)

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2