我正在尝试在R语言的图表中绘制“系统”变量。这是语言变量系统。我收到错误消息:“plot.new()中的错误:数字边距太大”我如何绘制“系统”?
这是我的代码:
## Setup the universe, the range of values that we will process.
sets_options("universe", seq(from = 0, to = 40, by = 0.1))
## Setup the Linguistic Variables for BMI, A1C blood pressure & underwriter rating.
variables <-
set(
bmi =
fuzzy_partition(varnames =
c(under = 9.25,
fit = 21.75,
over = 27.5,
obese = 35),
sd = 3.0),
a1c =
fuzzy_partition(varnames =
c(l = 4, n = 5.25, h = 7),
FUN = fuzzy_cone, radius = 5),
rating =
fuzzy_partition(varnames =
c(DC = 10, ST = 5, PF = 1),
FUN = fuzzy_cone, radius = 5),
bp =
fuzzy_partition(varnames =
c(norm = 0,
pre = 10,
hyp = 20,
shyp = 30),
sd = 2.5)
)
## set up rules
rules <-
set(
fuzzy_rule(bmi %is% under || bmi %is% obese || a1c %is% l,
rating %is% DC),
fuzzy_rule(bmi %is% over || a1c %is% n || bp %is% pre,
rating %is% ST),
fuzzy_rule(bmi %is% fit && a1c %is% n && bp %is% norm,
rating %is% PF)
)
## combine to a system
system <- fuzzy_system(variables, rules)
print(system)
plot(system) ## plots variables
答案 0 :(得分:0)
感谢您的评论。 我刚刚在下面添加了代码,它现在正在工作!
png("p3_sa_para.png", 800, 600)
par(mfrow=c(1,2))
plot(system, ylab="Beta",xlab="Iteration")
dev.off()