假設有這個函式sqrt(x^2) 0.9*sqrt(3.3-x^2)*sin(30*pi*x)這個函式生成一個形狀的圖heart

有沒有辦法使用 ggplot2 重現此功能來獲得紅色heart作為輸出?謝謝你的幫助。
uj5u.com熱心網友回復:
一個可能的解決方案:
f <- function(x) sqrt(x^2) 0.9*sqrt(3.3-x^2)*sin(30*(pi)*x)
ggplot()
xlim(-2, 2)
geom_function(fun = f, color="red")
theme(aspect.ratio=0.85)

轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/450728.html
