開始使用免費開始

調整標題的外觀

除了套用已定義的 theme 預設外,你也可以透過修改各種樣式屬性,進一步微調你的圖表。提示:你可以重複使用並覆寫上一個練習產生的 ilo_plot 變數——目前的圖已經顯示在右側視窗中。

本練習屬於課程

在 Tidyverse 中以資料溝通

檢視課程

練習說明

  • 使用自訂的 theme() 呼叫與 element_text()

    • 文字的字型 family 改為 "Bookman"
    • 另外,把標題註解color 分別改為 "gray25""gray30"
    • 副標題稍微大一點,將 size 提高到 12。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

ilo_plot <- ilo_plot +
  theme_minimal() +
  # Customize the "minimal" theme with another custom "theme" call
  theme(
    text = element_text(___ = ____),
    title = element_text(___ = ____),
    plot.caption = element_text(___ = ___),
    plot.subtitle = element_text(___ = ____)
  )

# Render the plot object
ilo_plot
編輯並執行程式碼