anvas_planet画一颗行星,R语言aRtsy包生成艺术
2021-09-19 本文已影响0人
youmigo
anvas_planet画一颗行星,R语言aRtsy包生成艺术



# Thu Sep 02 01:38:20 2021 edit
# 字符编码:UTF-8
# R 版本:R 4.1.1 x64 for window 11
# cgh163email@163.com
# 个人笔记不负责任,拎了个梨🍐🍈
#.rs.restartR()
rm(list = ls());gc()
library(aRtsy)#gg生成艺术·
? canvas_planet # 在画布上画一颗行星。
set.seed(1)
colors <- list(c("khaki1", "lightcoral", "lightsalmon"),
c("dodgerblue", "forestgreen", "white"),
c("gray", "darkgray", "beige"))
canvas_planet(colors, radius = c(800, 400, 150),
center.x = c(1, 500, 1100),
center.y = c(1400, 500, 1000),
starprob = 0.005)
# Thu Sep 02 20:10:50 2021 --
mycol <- list(rainbow(5),rainbow(5),rainbow(5),rainbow(5))
canvas_planet(mycol,
radius = c(300,500,80), # 大小
starprob = .7,#在外层空间绘制恒星的概率。
center.x = c(10, 500, 1100),
center.y = c(1400, 500, 1000),
light.right = F # 光的方向
)
ggplot2::ggsave(filename = 'canvas_planet画一颗行星3.jpg')
# Thu Sep 02 01:51:50 2021 --