r 用于抽取水合物的重新编码。动态cex和颜色仍然需要一些工作

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了r 用于抽取水合物的重新编码。动态cex和颜色仍然需要一些工作相关的知识,希望对你有一定的参考价值。

ramp <- colorRamp(c("darkred", "darkblue","green","black"))
x=seq(0,2*pi,by=0.001)
plot(sin(x)*cos(x)*exp(-sin(x)^3), sin(x)^2*cos(x)*exp(cos(x)^1/3),
     pch=20, cex=5/x, col=rgb( ramp(seq(0, 1, length = 20)), max = 255), xlab="", ylab="",xaxt="n", yaxt="n", asp=1 )
x=seq(0,10*pi,by=0.001)
plot(sin(x)*cos(x)*exp(-sin(x)^3), sin(x)^2*cos(x)*exp(cos(x)^1/3),
    pch=20, cex=5/x, col=sort(colors()[abs(rnorm(256,150,40))]) )
    
# with mixed pch
plot(sin(x)*cos(x)*exp(-sin(x)^3), sin(x)^2*cos(x)*exp(cos(x)^1/3),
    pch=rep(0:25, 1208), cex=7./x, col=sort(colors()[abs(rnorm(256,150,40))]))
    
# with colors from shape package
require("shape")
couleur = intpalette(c("black","dimgray","firebrick4"), numcol=100)
plot(sin(x)*cos(x)*exp(-sin(x)^3), sin(x)^2*cos(x)*exp(cos(x)^1/3), pch=20, cex=10/x, col=couleur)

# Annabelle's favorite
x=seq(0,10*pi,by=0.001)
plot(sin(x)*cos(x)*exp(-sin(x)^3), sin(x)^2*cos(x)*exp(cos(x)^1/3),
      pch=20, cex=4/x, col=rnorm(629,120,30) )
# or
x=seq(0,2*pi,by=0.001)
plot(sin(x)*cos(x)*exp(-sin(x)^3), sin(x)^2*cos(x)*exp(cos(x)^1/3),
    pch=20, cex=5/x, col=rnorm(629,120,30) )
    
# Series
x=seq(0,2*pi,by=0.001)
par(mar=c(0.2, 0.2, 0.2, 0.2), mfrow=c(3,3),
    oma = c(0.2, 0.2, 0.2, 0.2))
for (i in 1:9) {
plot(0,type='n',axes=FALSE,ann=FALSE, xlim=c(-1,1),ylim=(c(-.3,.5)))
points(sin(x)*cos(x)*exp(-sin(x)^3), sin(x)^2*cos(x)*exp(cos(x)^1/3),
    pch=20, cex=7/x, col=abs(rnorm(6284,120,30)) )
}

# Serie with 5 panels and pch variation
x=seq(0,2*pi,by=0.001)
> par(mar=c(0.2, 0.2, 0.2, 0.2), mfrow=c(1,5),
+     oma = c(0.2, 0.2, 0.2, 0.2))
for (i in 5:9) {
    plot(0,type='n',axes=FALSE,ann=FALSE, xlim=c(-1,1),ylim=(c(-.3,.5)))
    points(sin(x)*cos(x)*exp(-sin(x)^(3)), sin(x)^2*cos(x)*exp(cos(x)^1/3),
        pch=12+i, cex=10/(x*i^(1/2)), col=sort(abs(rnorm(100*i,190,40))) )
}

以上是关于r 用于抽取水合物的重新编码。动态cex和颜色仍然需要一些工作的主要内容,如果未能解决你的问题,请参考以下文章

R语言颜色-图例legend及位置调整

是否有一个 R 函数用于在不使用循环的情况下根据另一列的修改版本重新编码列?

手把手教分析|R语言绘制蜜蜂图

求助:R作图,坐标轴显示的问题

用于绘制三元/三角形图的库/工具 [关闭]

聚合物1.2:更改纸张选定的背景颜色