r 用于绘制曲线的Wahrol方式(ché背景)
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了r 用于绘制曲线的Wahrol方式(ché背景)相关的知识,希望对你有一定的参考价值。
par(mar=c(0,0,0,0), mfrow=c(3,3), oma = c(0,0,0,0))
fonctions <- list (fonc1 = function(x) sin(cos(x)*exp(-x/2)),
fonc2 = function(x) sin(cos(x)*exp(-x/2))/tan(x),
fonc3 = function(x) sin(cos(x)*exp(-x^2))/tan(x),
fonc4 = function(x) sin(cos(x)*exp(-x/20))/tan(x),
fonc5 = function(x) sin(cos(x)*exp(x/2)),
fonc6 = function(x) sin(cos(x)*exp(-x/2)),
fonc7 = function(x) sin(cos(x)*exp(-x/2))/tan(x),
fonc8 = function(x) sin(cos(x)*exp(-x^2))/tan(x),
fonc4 = function(x) sin(cos(x)*exp(-x/20))/tan(x) )
couleurs = c("deeppink3","yellow2","darkslategray", "red3","darkorange","royalblue4","yellowgreen","steelblue","yellow2")
backgrounds = c("yellow2","steelblue","royalblue4", "darkorange","red3","yellowgreen","darkslategray","yellow2","deeppink3")
for (i in 1:9) {
plot(1, type="n", axes=F, xlab="", ylab="", xlim=c(-8,7), ylim=c(-5,5))
symbols(0,0, squares=c(100), inches=F, fg="white",bg=backgrounds[i], add=T)
myfunc = fonctions[[i]]
curve(myfunc, -8, 7, n = 2001, col=couleurs[i], lwd=7, add=T)
}
## with function diversification and work on dispositon and colors
par(mar=c(0,0,0,0), mfrow=c(3,3), oma = c(0,0,0,0))
fonctions <- list (fonc1 = function(x) sin(cos(x)*exp(-x/2)),
fonc2 = function(x) sin(cos(x)*exp(-x/2))/tan(x),
fonc3 = function(x) sin(cos(x)*exp(-x^2))/tan(x),
fonc4 = function(x) sin(cos(x)*exp(-x/20))/tan(x),
fonc5 = function(x) sin(cos(x)*exp(x/2)),
fonc6 = function(x) sin(x)*log(x^2,2),
fonc7 = function(x) sin(cos(x)*exp(-x/2))/tan(x),
fonc8 = function(x) sin(cos(x)*exp(-x^2))/tan(x),
fonc9 = function(x) -(x^2/3)+4 )
couleurs = c("deeppink3","yellow2","darkorange", "red3","steelblue","royalblue4","yellowgreen","darkslategray","yellow2")
backgrounds = c("yellow2","steelblue","royalblue4", "darkorange","red3","yellowgreen","darkslategray","yellow2","deeppink3")
for (i in 1:9) {
plot(1, type="n", axes=F, xlab="", ylab="", xlim=c(-8,7), ylim=c(-5,5))
symbols(0,0, squares=c(100), inches=F, fg="white",bg=backgrounds[i], add=T)
myfunc = fonctions[[i]]
curve(myfunc, -8, 7, n = 2001, col=couleurs[i], lwd=7, add=T)
}
以上是关于r 用于绘制曲线的Wahrol方式(ché背景)的主要内容,如果未能解决你的问题,请参考以下文章
r R脚本用于从数据生成和绘制ROC曲线
R语言绘制物种累计曲线
使用 survminer::ggsurvplot 在 r 中以编程方式绘制许多生存曲线的问题
R语言生存分析之组间生存曲线的对比: Log-Rank检验绘制漂亮的生存曲线
R语言绘制KS曲线;R语言实现KS曲线
R语言绘制生存曲线95%区间