SMAC-Group/wv

Names handover to legend in compare_wvar wrongly

Opened this issue · 0 comments

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'))