【问题标题】:x and y limits for qqplot using car package in R在R中使用汽车包的qqplot的x和y限制
【发布时间】:2017-11-15 23:18:35
【问题描述】:

我使用 R 中的 car 包生成了一个 qqplot,但无法调整 x 和 y 比例。图表如下所示:

我需要放大 x 和 y 轴以查看它们与置信区间的接近程度。有没有办法解决这个问题? car 包中的 qqPlot 函数没有参数 xlim 和 ylim Arguments of qqPlot in car package

【问题讨论】:

  • 请附上一些示例代码和数据

标签: r plot quantile


【解决方案1】:

编辑:我的错误。我没有仔细阅读以看出您正在使用汽车包装。在您的问题中添加示例代码将来会很有用。

看起来 car::qqPlot 中的坐标轴可能无法调整。根据此答案 (car package to qqplot in R - how to insert the scale of x and y axis) 中的建议,请尝试改用基本功能 (stats::qqplot)。


尝试在你的 qqplot 函数中调用 xlim 和 ylim。

这是一个使用 ?qqplot 文档中的示例数据的示例:

## data
y <- rt(200, df = 5)

## plot will have x-axis from -4 to 6 and y-axis from -4 to 4
qqplot(y, rt(300, df = 5)) 

## plot will have x-axis from -4 to 2 and y-axis from -4 to 0
qqplot(y, rt(300, df = 5), 
       ylim = c(-4, 0), 
       xlim = c(-4, 2))

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-28
    • 1970-01-01
    • 1970-01-01
    • 2018-01-12
    相关资源
    最近更新 更多