如何在R中使用“ggplot2”绘制“fevd”对象?

如何在R中使用“ggplot2”绘制“fevd”对象?,r,plot,ggplot2,R,Plot,Ggplot2,我现在正在使用extRemespackage进行极值分析,我想为我的结果绘制返回水平图。我发现包中的默认plot函数不好,例如,我无法设置线条颜色、x标签和标题。我想知道我们是否可以在ggplot2中这样做 library(extRemes) library(xts) library(ismev) library(ggplot2) data(rain) precipitation <- rain Daily <- seq(as.Date('1914-01-01'),as.Date(

我现在正在使用
extRemes
package进行极值分析,我想为我的结果绘制返回水平图。我发现包中的默认
plot
函数不好,例如,我无法设置线条颜色、x标签和标题。我想知道我们是否可以在
ggplot2
中这样做

library(extRemes)
library(xts)
library(ismev)
library(ggplot2)

data(rain)
precipitation <- rain
Daily <- seq(as.Date('1914-01-01'),as.Date('1961-12-30'),by = 1)
precipitation_xts <- xts(precipitation,Daily)
ams <- apply.yearly(precipitation_xts, FUN=max)
ams_df <- fortify(ams)
colnames(ams_df)[1] <- "Date"

mle <- fevd(x=ams, data=ams_df, location.fun=~Date, method = "MLE", type="GEV")
plot(x=mle, type="rl",rperiods=c(5,50,100))
库(极端)
图书馆(xts)
图书馆(ismev)
图书馆(GG2)
数据(雨水)

降水绘图mle将使用函数
plot.fevd.mle
。这是一个很长的函数-需要重写才能使其成为友好的ggplot2是的,默认函数是
plot.fevd.mle
,它不友好。