首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >迫使向日葵地从x=0开始

迫使向日葵地从x=0开始
EN

Stack Overflow用户
提问于 2021-07-15 12:21:28
回答 1查看 50关注 0票数 0

创建向日葵图进行logistic回归时,x轴从2开始。我能改变这种行为使x轴从0开始吗?我已经尝试通过更改x轴来手动更改它,但这并没有使x=0可见(参见#c1)。

现在的向日葵地块图像,从x=2开始;

代码语言:javascript
复制
# 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)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-07-15 12:28:20

sunflowerplot对x轴的限制有一个参数xlim

比较

代码语言:javascript
复制
sunflowerplot(iris$Sepal.Length, iris$Sepal.Width)

代码语言:javascript
复制
sunflowerplot(iris$Sepal.Length, iris$Sepal.Width, xlim = c(0, 20))
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68393741

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档