1
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ggplot2の図にさくっとメイリオフォントを埋め込む(Windows 10)

Posted at

ggplot2 (3.3.3) の図にメイリオフォントを埋め込んで,PDF出力する手順の自分用メモ.

# Windowsフォントを設定
windowsFonts(Meiryo = windowsFont("Meiryo"))
ggplot() + 
  ...
  # geom_text, geom_labelがある場合は,その中でもフォントファミリーを指定
  geom_text(..., family = "Meiryo") +
  # themeのベースファミリーを指定
  theme_**(base_family = "Meiryo")
# deviceにcario_pdfを指定
ggsave(..., device = cario_pdf)

さらに詳細な設定については以下を参照.

1
5
0

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
1
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?