私は出版物用のグラフを生成していますが、ggplot自体で図のパネルにラベルを付けることができます出版社などへ)、最終的な文書にきちんと合っているようにしてください。私はタイトルに手紙( "A")を追加することでこれをやろうとしていましたが、タイトルを中心にしたいと思います。左上の手紙を欲しいです。今プロットラベル(文字 "A"など)をggplot2プロットに追加
# base graph:
ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, color = Species, shape = Species))+
geom_jitter(size = 6.5)+
ggtitle("A \n \n The Actual Long, Normal Title of Titliness")+
theme(plot.title = element_text(hjust = 0.5, face = "bold", size = 30),
axis.ticks = element_blank(),
legend.text = element_text(size = 25),
axis.title = element_text(size = 25, face = "bold"),
axis.text = element_text(size = 25, vjust = 0.05),
legend.position = "bottom")
私は手の間隔各タイトルでわずか「それ偽物」と喜んでいる場合、私は一種のそれが仕事を得ることができますが、これは時間のようです集中的かつ原油的である。
# sloppy solution
ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, color = Species, shape = Species))+
geom_jitter(size = 6.5)+
ggtitle("A \n \n The Actual Long, Normal Title of Titliness")+
theme(plot.title = element_text(hjust = 0,face = "bold", size = 30),
axis.ticks = element_blank(),
legend.text = element_text(size = 25),
axis.title = element_text(size = 25, face = "bold"),
axis.text = element_text(size = 25, vjust = 0.05),
legend.position = "bottom")
、独自のhjust値ごとに個別のタイトルの各「行」をコールする方法はありますか?
他の創造的なソリューションはありますか?
また、私はmtext(Splitting axis labels with expressions)の可能性を見ましたが、ggplot2を使って実装する方法を理解できませんでした(対ベースプロット関数..互換性がないようです)。 この投稿は面白い(Multi-line ggplot Title With Different Font Size, Face, etc)のすべての種類だったが、私はまだRの新人であり、変更するにはこの巧妙なものを編集する方法を理解できなかったインデント。
ありがとうございます!
[cowplot](https://cran.r-project.org/web/packages/cowplot/vignettes/introduction.html)のようなサウンドが必要な場合があります。 – neilfws
私はcowplotを使って答えを加えました。 –