20180514-A · Star Wars Survey · ggplot2 ggdraw geom_bar facet_grid magick 柱状图 条形图 · R 语言数据可视化 案例 源码
生活随笔
收集整理的這篇文章主要介紹了
20180514-A · Star Wars Survey · ggplot2 ggdraw geom_bar facet_grid magick 柱状图 条形图 · R 语言数据可视化 案例 源码
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
所有作品合集傳送門: Tidy Tuesday
2018 年合集傳送門: 2018
Star Wars Survey
歡迎來到ggplot2的世界!
ggplot2是一個用來繪制統(tǒng)計圖形的 R 軟件包。它可以繪制出很多精美的圖形,同時能避免諸多的繁瑣細(xì)節(jié),例如添加圖例等。
用 ggplot2 繪制圖形時,圖形的每個部分可以依次進(jìn)行構(gòu)建,之后還可以進(jìn)行編輯。ggplot2 精心挑選了一系列的預(yù)設(shè)圖形,因此在大部分情形下可以快速地繪制出許多高質(zhì)量的圖形。如果在格式上還有額外的需求,也可以利用 ggplot2 中的主題系統(tǒng)來進(jìn)行定制, 無需花費(fèi)太多時間來調(diào)整圖形的外觀,而可以更加專注地用圖形來展現(xiàn)你的數(shù)據(jù)。
1. 一些環(huán)境設(shè)置
# 設(shè)置為國內(nèi)鏡像, 方便快速安裝模塊 options("repos" = c(CRAN = "https://mirrors.tuna.tsinghua.edu.cn/CRAN/"))2. 設(shè)置工作路徑
wkdir <- '/home/user/R_workdir/TidyTuesday/2018/2018-05-14_Star_Wars_Survey/src-a' setwd(wkdir)3. 加載 R 包
library(tidyverse) library(ggpubr) library(cowplot)# 導(dǎo)入字體設(shè)置包 library(showtext) # font_add_google() showtext 中從谷歌字體下載并導(dǎo)入字體的函數(shù) # name 中的是字體名稱, 用于檢索, 必須嚴(yán)格對應(yīng)想要字體的名字 # family 后面的是代碼后面引用時的名稱, 自己隨便起 # 需要能訪問 Google, 也可以注釋掉下面這行, 影響不大 # font_families_google() 列出所有支持的字體, 支持的漢字不多 # http://www.googlefonts.net/ font_add_google(name = "Karantina", family = "Karantina") font_add_google(name = "ZCOOL XiaoWei", family = "zxw")# 后面字體均可以使用導(dǎo)入的字體 showtext_auto()4. 加載數(shù)據(jù)
# 加載數(shù)據(jù)對象 df_input <- read_csv('../data/week7_starwars.csv', col_names = FALSE)# 簡要查看數(shù)據(jù)內(nèi)容 glimpse(df_input) ## Rows: 1,188 ## Columns: 38 ## $ X1 <chr> "RespondentID", NA, "3292879998", "3292879538", "3292765271", "329… ## $ X2 <chr> "Have you seen any of the 6 films in the Star Wars franchise?", "R… ## $ X3 <chr> "Do you consider yourself to be a fan of the Star Wars film franch… ## $ X4 <chr> "Which of the following Star Wars films have you seen? Please sele… ## $ X5 <chr> NA, "Star Wars: Episode II Attack of the Clones", "Star Wars: Epi… ## $ X6 <chr> NA, "Star Wars: Episode III Revenge of the Sith", "Star Wars: Epi… ## $ X7 <chr> NA, "Star Wars: Episode IV A New Hope", "Star Wars: Episode IV A… ## $ X8 <chr> NA, "Star Wars: Episode V The Empire Strikes Back", "Star Wars: Ep… ## $ X9 <chr> NA, "Star Wars: Episode VI Return of the Jedi", "Star Wars: Episod… ## $ X10 <chr> "Please rank the Star Wars films in order of preference with 1 bei… ## $ X11 <chr> NA, "Star Wars: Episode II Attack of the Clones", "2", NA, "2", "… ## $ X12 <chr> NA, "Star Wars: Episode III Revenge of the Sith", "1", NA, "3", "… ## $ X13 <chr> NA, "Star Wars: Episode IV A New Hope", "4", NA, "4", "2", "2", "… ## $ X14 <chr> NA, "Star Wars: Episode V The Empire Strikes Back", "5", NA, "5", … ## $ X15 <chr> NA, "Star Wars: Episode VI Return of the Jedi", "6", NA, "6", "3",… ## $ X16 <chr> "Please state whether you view the following characters favorably,… ## $ X17 <chr> NA, "Luke Skywalker", "Very favorably", NA, "Somewhat favorably", … ## $ X18 <chr> NA, "Princess Leia Organa", "Very favorably", NA, "Somewhat favora… ## $ X19 <chr> NA, "Anakin Skywalker", "Very favorably", NA, "Somewhat favorably"… ## $ X20 <chr> NA, "Obi Wan Kenobi", "Very favorably", NA, "Somewhat favorably", … ## $ X21 <chr> NA, "Emperor Palpatine", "Very favorably", NA, "Unfamiliar (N/A)",… ## $ X22 <chr> NA, "Darth Vader", "Very favorably", NA, "Unfamiliar (N/A)", "Very… ## $ X23 <chr> NA, "Lando Calrissian", "Unfamiliar (N/A)", NA, "Unfamiliar (N/A)"… ## $ X24 <chr> NA, "Boba Fett", "Unfamiliar (N/A)", NA, "Unfamiliar (N/A)", "Some… ## $ X25 <chr> NA, "C-3P0", "Very favorably", NA, "Unfamiliar (N/A)", "Very favor… ## $ X26 <chr> NA, "R2 D2", "Very favorably", NA, "Unfamiliar (N/A)", "Very favor… ## $ X27 <chr> NA, "Jar Jar Binks", "Very favorably", NA, "Unfamiliar (N/A)", "Ve… ## $ X28 <chr> NA, "Padme Amidala", "Very favorably", NA, "Unfamiliar (N/A)", "Ve… ## $ X29 <chr> NA, "Yoda", "Very favorably", NA, "Unfamiliar (N/A)", "Very favora… ## $ X30 <chr> "Which character shot first?", "Response", "I don't understand thi… ## $ X31 <chr> "Are you familiar with the Expanded Universe?", "Response", "Yes",… ## $ X32 <chr> "Do you consider yourself to be a fan of the Expanded Universe?\x8… ## $ X33 <chr> "Do you consider yourself to be a fan of the Star Trek franchise?"… ## $ X34 <chr> "Gender", "Response", "Male", "Male", "Male", "Male", "Male", "Mal… ## $ X35 <chr> "Age", "Response", "18-29", "18-29", "18-29", "18-29", "18-29", "1… ## $ X36 <chr> "Household Income", "Response", NA, "$0 - $24,999", "$0 - $24,999"… ## $ X37 <chr> "Education", "Response", "High school degree", "Bachelor degree", … ## $ X38 <chr> "Location (Census Region)", "Response", "South Atlantic", "West So… # 檢查數(shù)據(jù)的列名 colnames(df_input) ## [1] "X1" "X2" "X3" "X4" "X5" "X6" "X7" "X8" "X9" "X10" "X11" "X12" ## [13] "X13" "X14" "X15" "X16" "X17" "X18" "X19" "X20" "X21" "X22" "X23" "X24" ## [25] "X25" "X26" "X27" "X28" "X29" "X30" "X31" "X32" "X33" "X34" "X35" "X36" ## [37] "X37" "X38"5. 數(shù)據(jù)預(yù)處理
# 自定義一個函數(shù), 用于對一些列批量進(jìn)行因子轉(zhuǎn)換 funfactor <- function(x){factor(x, levels = c("Very favorably", "Somewhat favorably", "Neither favorably nor unfavorably (neutral)","Somewhat unfavorably", "Very unfavorably", "Unfamiliar (N/A)"),labels = c("非常喜歡的", "喜歡的", "中立的", "不喜歡的", "非常不喜歡的", "未知的")) } # slice() 通過行號選取數(shù)據(jù). 通過觀察, 剔除數(shù)據(jù)集的前三行 df_tidy <- df_input %>% dplyr::slice(3:n()) # 添加表頭 names(df_tidy) <- c("id", "seen_any", "fan", "SW1", "SW2", "SW3", "SW4", "SW5", "SW6", "RSW1", "RSW2", "RSW3", "RSW4", "RSW5", "RSW6",df_input[2,][16:29], "shot", "ext", "fan_ext", "Star_Trek", "gender", "age", "income", "edu", "location")# 整理繪圖數(shù)據(jù) df_plot <- df_tidy %>% # mutate() 主要用于在數(shù)據(jù)框中添加新的變量, 這些變量是通過對現(xiàn)有的變量進(jìn)行操作而形成的dplyr::mutate(seen_any = factor(seen_any, levels = c("Yes", "No"), labels = c("TRUE", "FALSE")),fan = factor(fan, levels = c("Yes", "No"), labels = c("TRUE", "FALSE")),ext = factor(ext, levels = c("Yes", "No"), labels = c("TRUE", "FALSE")),fan_ext = factor(fan_ext, levels = c("Yes", "No"), labels = c("TRUE", "FALSE")),SW1 = str_replace(SW1, "Star Wars: Episode I The Phantom Menace", "TRUE"),SW2 = str_replace(SW2, "Star Wars: Episode II Attack of the Clones", "TRUE"),SW3 = str_replace(SW3, "Star Wars: Episode III Revenge of the Sith", "TRUE"),SW4 = str_replace(SW4, "Star Wars: Episode IV A New Hope", "TRUE"),SW5 = str_replace(SW5, "Star Wars: Episode V The Empire Strikes Back", "TRUE"),SW6 = str_replace(SW6, "Star Wars: Episode VI Return of the Jedi", "TRUE")) %>% dplyr::mutate_at(vars(SW1:RSW6, shot:Star_Trek, location), factor) %>% dplyr::mutate_at(vars(`Han Solo`:`Yoda`), funfactor) %>% dplyr::mutate(income = factor(income, levels = c("$0 - $24,999", "$25,000 - $49,999","$50,000 - $99,999","$100,000 - $149,999","$150,000+")),edu = factor(edu, levels = c("Less than high school degree","High school degree","Some college or Associate degree","Bachelor degree","Graduate degree")))6. 利用 ggplot2 繪圖
6.1 最喜歡的一集星球大戰(zhàn)
namesw <- c("星球大戰(zhàn)1:\n幽靈的威脅", "星球大戰(zhàn)2:\n克隆人的攻擊", "星球大戰(zhàn)3:\n西斯的復(fù)仇", "星球大戰(zhàn)4:\n新希望","星球大戰(zhàn)5:\n帝國反擊戰(zhàn)","星球大戰(zhàn)6:\n絕地歸來")# 獲得看過星球大戰(zhàn)1-6的男性和女性比例 df_albert <- df_plot %>% # select() 選擇需要使用的列select(SW1:SW6, gender) %>% # gather() 數(shù)據(jù)收縮、從寬表到長表. key 將原數(shù)據(jù)框中所有的列賦值給這個變量; value 將原數(shù)據(jù)框中所有的值賦值給這個變量gather(SW1:SW6, key = "Episode", value = "seen") %>% # group_by() 以指定的列進(jìn)行分組group_by(Episode, gender) %>% # summarise() 用于對數(shù)據(jù)進(jìn)行統(tǒng)計描述summarise(count = sum(seen == 'TRUE', na.rm = TRUE)) %>% # 以電影為分類, 進(jìn)一步計算看過各個電影的男女比例group_by(Episode) %>% # 計算百分比mutate(perc = paste0(round(count / sum(count) * 100, 2), '%')) %>%# 去除缺失值, 即未知數(shù)據(jù)drop_na() %>%ungroup()# 加載一個本地圖片 internet.img <- magick::image_read('../data/starwars.jpg') %>%magick::image_colorize(opacity = 28, color = 'white')# PS: 方便講解, 我這里進(jìn)行了拆解, 具體使用時可以組合在一起 gg <- df_albert %>% ggplot(aes(x = Episode, y = perc, fill = gender)) # geom_bar() 繪制條形圖, stat = "identity",意味著條形的高度表示數(shù)據(jù)數(shù)據(jù)的值 gg <- gg + geom_bar(stat = "identity", position = position_dodge(width = 0.5)) # scale_x_discrete() 對離散的坐標(biāo)軸更改范圍、坐標(biāo)軸標(biāo)簽等 gg <- gg + scale_x_discrete(labels = namesw) # scale_fill_discrete() 修改圖例順序, breaks 是原數(shù)據(jù), labels 是新的標(biāo)簽, 需要一一對應(yīng) gg <- gg + scale_fill_discrete(name = NULL, breaks = c('Male', 'Female'), label = c('男性', '女性')) # geom_text() 添加文本信息 gg <- gg + geom_text(aes(label = perc), size = 7, position = position_dodge(width = 1), inherit.aes = TRUE, family = 'Karantina') # coord_flip() 橫縱坐標(biāo)位置轉(zhuǎn)換 gg <- gg + coord_flip() # theme_minimal() 去坐標(biāo)軸邊框的最小化主題 gg <- gg + theme_minimal() # labs() 對圖形添加注釋和標(biāo)簽(包含標(biāo)題 title、子標(biāo)題 subtitle、坐標(biāo)軸 x & y 和引用 caption 等注釋) gg <- gg + labs(x = NULL, y = NULL, title = '《星球大戰(zhàn)》中哪一集最受歡迎',caption = '數(shù)據(jù)來源: fivethirtyeight.com | GRAPH: 數(shù)繪小站') # theme() 實(shí)現(xiàn)對非數(shù)據(jù)元素的調(diào)整, 對結(jié)果進(jìn)行進(jìn)一步渲染, 使之更加美觀 gg <- gg + theme(# panel.grid.major 主網(wǎng)格線panel.grid.major = element_blank(),# panel.grid.minor 次網(wǎng)格線panel.grid.minor = element_blank(),# plot.background 圖片背景plot.background = element_rect(color = '#DCDCDC', fill = '#DCDCDC', size = 2),# plot.margin 調(diào)整圖像邊距, 上-右-下-左plot.margin = unit(c(1.05, .456, .65, 0.1), "cm"),# plot.title 主標(biāo)題plot.title = element_text(color = "black", size = 24, face = "bold", vjust = -0.5, family = 'zxw'),# axis.text 坐標(biāo)軸刻度文本axis.text = element_text(size = 16, face = "bold", family = 'zxw'),# legend.position 設(shè)置圖例位置, 這里設(shè)置圖例的絕對位置legend.position = c(0.78 , 1.025),# legend.direction 設(shè)置圖例的方向 horizontal 表示水平擺放legend.direction = "horizontal",# legend.text 設(shè)置圖例文本格式legend.text = element_text(size = 16, face = "bold", family = 'zxw'),# plot.caption 說明文字plot.caption = element_text(color = "red", size = 10, face = "bold", hjust = 0.8),axis.text.x = element_blank(),# legend.background 設(shè)置圖例的背景legend.background = element_blank())# 利用 cowplot::ggdraw 合并多個圖 merge.gg <- ggdraw() merge.gg <- merge.gg + draw_plot(gg, x = 0., y = 0., height = 1.01, width = 1.02) merge.gg <- merge.gg + draw_image(internet.img, x = 0.725, y = 0.622, height = 0.235 , width = 0.235)merge.gg6.2 根據(jù)對不同角色喜歡程度進(jìn)行分類繪圖
# 根據(jù)對星球大戰(zhàn)中不同角色的喜歡程度進(jìn)行分類 df_albert <- df_plot %>% # select() 選擇需要使用的列, 這里挑選角色名字和性別select(`Han Solo`:`Yoda`, gender) %>% # 去除缺失值drop_na() %>% # gather() 數(shù)據(jù)收縮、從寬表到長表. key 將原數(shù)據(jù)框中所有的列賦值給這個變量; value 將原數(shù)據(jù)框中所有的值賦值給這個變量gather(`Han Solo`:`Yoda`, key = "charactor", value = "rank") %>% # group_by() 以指定的列進(jìn)行分組 group_by(charactor, gender, rank) %>% # summarise() 用于對數(shù)據(jù)進(jìn)行統(tǒng)計描述summarise(count = n()) %>% # group_by() 以指定的列進(jìn)行分組 group_by(charactor) %>% # mutate() 主要用于在數(shù)據(jù)框中添加新的變量, 這些變量是通過對現(xiàn)有的變量進(jìn)行操作而形成的dplyr::mutate(perc = paste0(round(count/sum(count) * 100, 2), '%')) %>%dplyr::mutate(perc =round(count/sum(count) * 100, 2)) %>%dplyr::mutate(rank = factor(rank, levels = c("非常喜歡的", "喜歡的", "中立的", "不喜歡的", "非常不喜歡的", "未知的"))) %>%# ungroup() 取消分組ungroup()# 加載一個本地圖片 internet.img <- magick::image_read('../data/starwars.jpg') %>%magick::image_colorize(opacity = 82, color = 'white')# PS: 方便講解, 我這里進(jìn)行了拆解, 具體使用時可以組合在一起 hh <- df_albert %>% ggplot(aes(x = charactor, y = perc, fill = gender)) # geom_bar() 繪制條形圖, stat = "identity",意味著條形的高度表示數(shù)據(jù)數(shù)據(jù)的值 hh <- hh + geom_bar(stat = "identity", position = position_dodge(width = 0.5)) # facet_grid() 分面并且標(biāo)簽內(nèi)容顯示在頂部 hh <- hh + facet_grid(~rank) # coord_flip() 橫縱坐標(biāo)位置轉(zhuǎn)換 hh <- hh + coord_flip() # geom_text() 添加文本信息 hh <- hh + geom_text(aes(label = perc, y = perc + 4.0), size = 4, position = position_dodge(width = 1), inherit.aes = TRUE) # scale_fill_discrete() 修改圖例順序, breaks 是原數(shù)據(jù), labels 是新的標(biāo)簽, 需要一一對應(yīng) hh <- hh + scale_fill_discrete(name = NULL, breaks = c('Male', 'Female'), label = c('男性', '女性')) # ylim() 設(shè)置坐標(biāo)軸的范圍 hh <- hh + ylim(0, 45) # theme_minimal() 去坐標(biāo)軸邊框的最小化主題 hh <- hh + theme_minimal() # labs() 對圖形添加注釋和標(biāo)簽(包含標(biāo)題 title、子標(biāo)題 subtitle、坐標(biāo)軸 x & y 和引用 caption 等注釋) hh <- hh + labs(x = NULL, y = NULL, title = '《星球大戰(zhàn)》中你最喜歡哪一個角色',caption = '數(shù)據(jù)來源: fivethirtyeight.com | GRAPH: 數(shù)繪小站') # theme() 實(shí)現(xiàn)對非數(shù)據(jù)元素的調(diào)整, 對結(jié)果進(jìn)行進(jìn)一步渲染, 使之更加美觀 hh <- hh + theme(# panel.grid.major 主網(wǎng)格線panel.grid.major.x = element_blank(),# panel.grid.minor 次網(wǎng)格線panel.grid.minor = element_blank(),# plot.background 圖片背景plot.background = element_blank(),# plot.margin 調(diào)整圖像邊距, 上-右-下-左plot.margin = unit(c(1.05, .856, 0.45, 0.1), "cm"),# plot.title 主標(biāo)題plot.title = element_text(color = "black", size = 28, face = "bold", vjust = 0.5, family = 'zxw'),# axis.text 坐標(biāo)軸刻度文本axis.text = element_text(size = 16, face = "bold", family = 'zxw'),# legend.position 設(shè)置圖例位置, 這里設(shè)置圖例的絕對位置legend.position = c(-0.101 , 1.078),# legend.direction 設(shè)置圖例的方向 horizontal 表示水平擺放legend.direction = "horizontal",# legend.text 設(shè)置圖例文本格式legend.text = element_text(size = 16, face = "bold", family = 'zxw'),# plot.caption 說明文字plot.caption = element_text(color = "red", size = 10, face = "bold", hjust = 0.8),strip.text.x = element_text(size = 14, colour = "#FC0043"),axis.text.x = element_blank(),# legend.background 設(shè)置圖例的背景legend.background = element_blank())# 利用 cowplot::ggdraw 合并多個圖 merge.hh <- ggdraw() merge.hh <- merge.hh + draw_image(internet.img, x = -0.05, y = 0., height = 1.12, width = 1.12) merge.hh <- merge.hh + draw_plot(hh, x = 0., y = 0., height = 1.01, width = 1.02) merge.hh7. 保存圖片到 PDF 和 PNG
filename = '20180514-A-01' ggsave(merge.gg, filename = paste0(filename, ".pdf"), width = 10.2, height = 6.3, device = cairo_pdf) ggsave(merge.gg, filename = paste0(filename, ".png"), width = 10.2, height = 6.3, dpi = 100, device = "png")filename = '20180514-A-02' ggsave(merge.hh, filename = paste0(filename, ".pdf"), width = 14.2, height = 7.3, device = cairo_pdf) ggsave(merge.hh, filename = paste0(filename, ".png"), width = 14.2, height = 7.3, dpi = 100, device = "png")8. session-info
sessionInfo() ## R version 4.2.1 (2022-06-23) ## Platform: x86_64-pc-linux-gnu (64-bit) ## Running under: Ubuntu 20.04.5 LTS ## ## Matrix products: default ## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3 ## ## locale: ## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C ## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 ## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 ## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C ## [9] LC_ADDRESS=C LC_TELEPHONE=C ## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C ## ## attached base packages: ## [1] stats graphics grDevices utils datasets methods base ## ## other attached packages: ## [1] showtext_0.9-5 showtextdb_3.0 sysfonts_0.8.8 cowplot_1.1.1 ## [5] ggpubr_0.4.0 forcats_0.5.2 stringr_1.4.1 dplyr_1.0.10 ## [9] purrr_0.3.4 readr_2.1.2 tidyr_1.2.1 tibble_3.1.8 ## [13] ggplot2_3.3.6 tidyverse_1.3.2 ## ## loaded via a namespace (and not attached): ## [1] httr_1.4.4 sass_0.4.2 bit64_4.0.5 ## [4] vroom_1.5.7 jsonlite_1.8.2 carData_3.0-5 ## [7] modelr_0.1.9 bslib_0.4.0 assertthat_0.2.1 ## [10] highr_0.9 googlesheets4_1.0.1 cellranger_1.1.0 ## [13] yaml_2.3.5 pillar_1.8.1 backports_1.4.1 ## [16] glue_1.6.2 digest_0.6.29 ggsignif_0.6.3 ## [19] rvest_1.0.3 colorspace_2.0-3 htmltools_0.5.3 ## [22] pkgconfig_2.0.3 broom_1.0.1 haven_2.5.1 ## [25] magick_2.7.3 scales_1.2.1 tzdb_0.3.0 ## [28] googledrive_2.0.0 farver_2.1.1 generics_0.1.3 ## [31] car_3.1-0 ellipsis_0.3.2 cachem_1.0.6 ## [34] withr_2.5.0 cli_3.4.1 magrittr_2.0.3 ## [37] crayon_1.5.1 readxl_1.4.1 evaluate_0.16 ## [40] fs_1.5.2 fansi_1.0.3 rstatix_0.7.0 ## [43] xml2_1.3.3 textshaping_0.3.6 tools_4.2.1 ## [46] hms_1.1.2 gargle_1.2.1 lifecycle_1.0.3 ## [49] munsell_0.5.0 reprex_2.0.2 compiler_4.2.1 ## [52] jquerylib_0.1.4 systemfonts_1.0.4 rlang_1.0.6 ## [55] grid_4.2.1 rstudioapi_0.14 labeling_0.4.2 ## [58] rmarkdown_2.16 gtable_0.3.1 abind_1.4-5 ## [61] DBI_1.1.3 curl_4.3.2 R6_2.5.1 ## [64] lubridate_1.8.0 knitr_1.40 fastmap_1.1.0 ## [67] bit_4.0.4 utf8_1.2.2 ragg_1.2.3 ## [70] stringi_1.7.8 Rcpp_1.0.9 parallel_4.2.1 ## [73] vctrs_0.4.2 dbplyr_2.2.1 tidyselect_1.1.2 ## [76] xfun_0.32測試數(shù)據(jù)
配套數(shù)據(jù)下載:Star Wars Survey
總結(jié)
以上是生活随笔為你收集整理的20180514-A · Star Wars Survey · ggplot2 ggdraw geom_bar facet_grid magick 柱状图 条形图 · R 语言数据可视化 案例 源码的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。