今天是我個人挑戰賽的最後一篇文章。這段時間的自我要求與堅持,讓我走到這裡!這段旅程帶給我的是自律、是學習、是觀察,更是為下次旅程再出發的基石。
ggplot2 是我接觸 R 語言開始,就有在使用的套件。但過去僅止於基礎技術的應用。這次挑戰中,我更多的是學習到更深更廣泛的技巧,而在技術之外,視覺化的科學與統計科學同樣需要被納入考量。相信未來在資料視覺化的路上,會有更多風景與感觸。感謝 iThome 鐵人賽提供舞台,讓我能記錄與分享這系列的知識。
學習一項程式語言,我習慣先了解基本架構。ggplot2 跟我過去使用 SAS 的 PROC SGPLOT 以及 PROC TEMPLATE 的基礎概念很接近,都是透過不同圖層的疊加。換句話說,每個圖層都能獨立、不會彼此牽制,這對使用者來說是非常友善的。
ggplot(data = <DATA>,
aes(x = <X變數>, y = <Y變數>)) +
geom_<幾何圖層>() +
scale_x_continuous() +
facet_wrap(~ <分面變數>) +
theme_minimal() +
labs(title = "圖表標題",
x = "X軸標籤",
y = "Y軸標籤")
從基礎到進階:從 geom_point()
、geom_histogram()
開始,一步步走到 violin plot、heatmap,再到 extensions(ggrepel
、gghighlight
、ggstatsplot
、patchwork
等)。這些學習都是從需求面出發,結合技術與跨領域知識,才能產出最需要的結果。
當然,過程中也遇上了 ggplot2 4.0.0 的釋出:S7 架構、theme 改進、labels 新邏輯等,對大家真的是一大福音。尤其是 theme 改進後,可以更直覺地統一編輯顏色、間距、背景等,大幅增進使用便利性。
資料視覺化不只是把數據畫成圖,而是一場在 科學與藝術之間的平衡。它的首要任務,是忠實傳達數據的樣貌,避免任何誤導或扭曲。
然而,僅僅正確還不夠。一張好的圖,還必須具備美感。美學能引導注意、提升理解,讓觀者更快抓住重點。相反地,如果顏色刺眼、字體凌亂、設計失衡,即便數據正確,也會讓人難以聚焦,甚至失去耐心。
因此我們需要建立判斷標準,學會區分:
好的資料視覺化,不只是資訊的載體,而是 溝通的橋樑。它能讓數字說話,讓故事鮮活,更讓研究與洞見被理解、被記住。
這 30 天的旅程中,我分享了自己在視覺化領域向巨人們學習後的內容:
這三位前輩提供完全不同方向的價值,讓我更穩健地建構起自己的學習庫。而「分享」本身,就是成長最重要的環節。
到此,再次感謝這次挑戰賽參與的大家!
This final article concludes my 30-day Ironman Challenge, a journey of discipline, learning, and reflection. Starting from ggplot2 basics, I explored advanced techniques such as violin plots, heatmaps, and extensions like ggrepel, gghighlight, ggstatsplot, and patchwork. I also integrated the new features of ggplot2 4.0.0, including the S7 system, improved themes, and label handling.
Through this journey, I realized that data visualization is more than plotting—it is about balancing science and art. A good visualization must be accurate, clear, and aesthetically pleasing. It should tell a story, convey insights faithfully, and avoid misleading representations.
I am deeply grateful to iThome Ironman for this platform, and to mentors like Joachim Schork, Claus O. Wilke, and Cara Thompson for their inspiration. This is not the end, but the foundation for future exploration, combining ggplot2 with Shiny, Quarto, and AI. My persistence throughout this journey becomes the strength for my next departure.