R
plot()
函数的轴默认具有标题:
xlab = "Model Quanntiles"
ylab = "Empirical Quantiles"
我需要用巴西葡萄牙语的翻译替换文本。
我该怎么做?
我的代码只是打印了一个 fevd(拟合极值分布)对象的 QQ 图。
plot(fD31,type = "qq", main = "MLE", cex.main = 2)
我试图简单地替换 xlab 和 ylab 值,但它没有用。
plot(fD31,type = "qq", main = "MLE", cex.main = 2, xlab = "Quantis do Modelo",
ylab = "Quantis Empíricos")
编辑
我的完整代码:
D31 <- read.csv("file.csv")
# Variable CYCLES, containing 10.000 different values from 27945900 to 28875760
flmD31 <- fevd(D31$CYCLES, method = "Lmoments")
plot(flmD31,type = "qq", main = "LM", cex.main=2)
输出()
27947751L,...., 27947844L), method = "Lmoments", type = "GEV", period.basis = "year",
par.models = list(threshold = ~1, location = ~1, scale = ~1,
log.scale = FALSE, shape = ~1, term.names = list(threshold = character(0),
location = character(0), scale = character(0), shape = character(0))),
const.loc = TRUE, const.scale = TRUE, const.shape = TRUE,
n = 10000L, na.action = "na.fail", results = c(location = 27947289.4961838,
scale = 317.480635124479, shape = 0.740827367059249)), class = "fevd")
如果你想正确解决这个问题,你可能需要定义你自己的
plot.fevd
版本(也许还有 quantquant.plot.evd
和其他一些内部函数),它似乎手动定义了轴标题 - 这意味着你不能覆盖他们以正常的方式。
如果你想要一个 hacky 解决方案,你可以将当前轴标题的文本颜色更改为白色,然后在它们上面添加你自己的轴标签。
flmD31 <- fevd(mtcars$cyl, method = "Lmoments")
plot(flmD31,type = "qq",
main = "LM",
cex.main=2,
col.lab = 'white')
title(xlab = "Quantis do Modelo",
ylab = "Quantis Empíricos")
给:
请注意,这不是一个很好的解决方案,因为原始轴标题仍然存在,如果您输出为 PDF 格式,仍然会被例如拾取。屏幕阅读器请谨慎使用。