r - 强制向日葵图从 x=0 开始
问题描述
为逻辑回归创建向日葵图时,x 轴从 2 开始。我可以更改此行为以使 x 轴从 0 开始吗?我已经尝试通过更改 x 轴来手动更改它,但这并没有使 x=0 可见(参见#c1)。
当前的向日葵图图像,从 x=2 开始;
# EE contains the Likert Scale values
EE.min <- min(EE)
EE.max <- max(EE)
EE.x <- seq(EE.min, EE.max, length = 500)
New.EE <- data.frame(EE = EE.x)
# Creating prediction
EE.p <- predict(logit, New.EE, type = "response")
sunflowerplot(EE, cb, main = "Effort Expectancy",
xlab= "EE (5-point Likert-Scale)", ylab="Likelihood", yaxt="n", xaxt="n")
# c1:
axis(1, at = seq(0,5,0.5), labels = c(0, 0.5, 1, 1.5, 2, 2.5 , 3, 3.5, 4, 4.5, 5), las=1)
axis(2, at = seq(0,1,0.2), labels = c("No = 0", 0.2, 0.4, 0.6, 0.8, "Yes = 1"), las = 2)
abline(h = seq(0,1,0.2), lty = 2)
lines(EE.x, EE.p)
解决方案
sunflowerplot
有一个xlim
关于 x 轴范围的参数。
相比
sunflowerplot(iris$Sepal.Length, iris$Sepal.Width)
至
sunflowerplot(iris$Sepal.Length, iris$Sepal.Width, xlim = c(0, 20))
推荐阅读
- java - 当我使用 GSON 从服务器获取数据时,尝试在空对象引用上调用虚拟方法“java.util.List project_name.PageInfo.getUsers()”
- javascript - 如何在 fetch() 实际获取文件之前暂停 javascript 代码执行
- python - 使用 pgp_key.from_blob(key_string) 时的 ValueError("Expected: ASCII-armored PGP data")
- amazon-web-services - 如何从 AWS CloudFormation 安装用户定义的实例?
- javascript - JS SubtleCrypto RSA 加密和解密
- javascript - 安装 gpu.js 后运行电子应用程序出错
- memory - 可以在verilog中的任务中使用寄存器数组吗?
- javascript - 输出给定日期范围内每个网站 ID 的聊天和错过聊天的总和
- rx-java2 - RxJava如何重试链式平面图中的部分
- javascript - javascript 在 then 块中提交表单并使用 swal 从非异步函数返回 false