美文网首页
anvas_planet画一颗行星,R语言aRtsy包生成艺术

anvas_planet画一颗行星,R语言aRtsy包生成艺术

作者: youmigo | 来源:发表于2021-09-19 00:19 被阅读0次

anvas_planet画一颗行星,R语言aRtsy包生成艺术

canvas_planet画一颗行星2.jpg canvas_planet画一颗行星.jpg canvas_planet画一颗行星3.jpg
# 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 --

相关文章

网友评论

      本文标题:anvas_planet画一颗行星,R语言aRtsy包生成艺术

      本文链接:https://www.haomeiwen.com/subject/pzpcwltx.html