Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Names handover to legend in compare_wvar wrongly #15

Open
stefangachter opened this issue Dec 3, 2021 · 0 comments
Open

Names handover to legend in compare_wvar wrongly #15

stefangachter opened this issue Dec 3, 2021 · 0 comments

Comments

@stefangachter
Copy link

Dear all,
If I specify names list for legend, then compare_wvar throws an error:

compare_wvar(wv_Xt, wv_Yt, wv_Zt, names=list('Xt','Yt','Zt'))
Error in as.graphicsAnnot(legend) : 
  argument "legend" is missing, with no default

Full example, see below, I think that the bug is that name argument legend = should be added:

  if (graph_details$add_legend){
    legend(graph_details$legend_position, legend = graph_details$names, bty = "n",
           lwd = 1, pt.cex = graph_details$point_cex, pch = graph_details$point_pch,
           col = graph_details$col_wv)
  }

The full example:

n = 2.5*10^5
model = WN(sigma2 = 1) + AR(phi = 0.999, sigma2 = 10^(-5))
Xt = gen_gts(n = n, model = model)
wv_Xt = wvar(Xt)
model = WN(sigma2 = 1.03) + AR(phi = 0.9995, sigma2 = 0.5*10^(-5))
Yt = gen_gts(n = 4*n, model = model)
wv_Yt = wvar(Yt)
model = WN(sigma2 = 0.98) + AR(phi = 0.999, sigma2 = 10^(-5))
Zt = gen_gts(n = 2*n, model = model)
wv_Zt = wvar(Zt)
compare_wvar(wv_Xt, wv_Yt, wv_Zt, names=list('Xt','Yt','Zt'))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant