去你的七夕!敲代码比追女孩什么的有意思多了!
a <- seq(-5, 5, by=0.01)
b <- seq(-5, 5, by=0.01)
df <- transform(setNames(expand.grid(a, b), c("x", "y")),
ueq = (17*x^2 + 17*y^2 - 16*y*abs(x) + 150/(abs(10*x + sin(10*y)))^4 < 225) )
color <- ifelse(df$ueq == TRUE, 1 , 0)
data <- cbind(df,color)
library(ggplot2)
ggplot(data,aes(x, y, fill = color)) +
geom_raster() +
scale_fill_gradient(low = "white", high = "firebrick3") +
theme_classic() +
theme(legend.position = "none") +
annotate("text", x = 0, y = -4,
label = "17*x^2 + 17*y^2 - 16*abs(x)*y + frac(150, (5*x+sin5*y)^4) <225",
parse = TRUE)