Page 1 of 1

[SOLVED] Cross-variograms : variables labels on the plots

PostPosted: Thu Mar 15, 2018 3:26 pm
by dimitridor
Hello,

I computed experimental variograms for several variables with
vario.exp=vario.calc(dat,nlag=nlag, lag=lag, dirvect=dirvect)

Then I fitted a model to them with
vario.model=model.auto(vario.exp, struct=model.type, verbose=verbose, draw=draw, maxiter=10000, pos.legend=5)

I would like the name of the variables to appear on the plots. I've seen in the doc that I should use the option opt.varname=2, e.g. as follows:
vario.exp=vario.calc(dat,nlag=nlag, lag=lag, dirvect=dirvect, opt.varname=2)

I tried to add it to the 2 commands, but it didn't work. Would you please explain me how I should solve this issue?

Many thanks,
Dimitri

Re: Cross-variograms : variables labels on the plots

PostPosted: Sun Mar 18, 2018 9:16 pm
by Didier Renard
I tried to mimic the situation with a very small script:

db = db.create(x1=runif(10),x2=runif(10),z1=runif(10),z2=runif(10))
db = db.rename(db,"z1","toto")
db = db.rename(db,"z2","titi")
vario = vario.calc(db)
plot(vario,opt.varname=2)

The resulting figure displays the two simple variograms as wells as the cross-variogram.
On each figure, the name of the variable (as it was in the 'db' when the calculation took place) is displayed.

Of course (as the argument is passed using the '...' mechanism, this remains true in functions calling the procedure
for displaying variograms. For example:

model.auto(vario,opt.varname=2)

Hope this helps.

Re: Cross-variograms : variables labels on the plots

PostPosted: Mon Mar 19, 2018 3:07 pm
by dimitridor
Thank you for the explanations.

After some additional tests, it seems that there is a conflict with the pos.legend option. Following your example, this is crashing:

model.auto(vario, pos.legend=5, opt.varname=2)

with error message:

Error in legend(...) : unused argument (opt.varname = 2)

while

model.auto(vario,opt.varname=2)

works fine.

Can you tell me if there is a solution for that ? I would like to use the dirvect option of vario.calc and thus display the resulting directional variograms. The legend is thus welcome.

Thank you for your help.

Re: [SOLVED] Cross-variograms : variables labels on the plot

PostPosted: Mon Mar 19, 2018 3:16 pm
by Didier Renard
Hi Dimitri
The options pos.legend and opt.varname were incompatible. I just corrected this bug.
It will be OK in the next version.
(PS: I changed the subject to SOLVED: if not convinced, please change it back)

Re: [SOLVED] Cross-variograms : variables labels on the plot

PostPosted: Mon Mar 19, 2018 3:32 pm
by dimitridor
Thanks a lot for your reactivity, Didier.

When will this next release be available?

Re: [SOLVED] Cross-variograms : variables labels on the plot

PostPosted: Tue Mar 20, 2018 12:03 pm
by Didier Renard
In few days certainly ... as soon as we have solved our computer problems with new migration to Ubuntu

Re: [SOLVED] Cross-variograms : variables labels on the plot

PostPosted: Mon Apr 16, 2018 1:39 pm
by dimitridor
Hello Didier,

Did you solve your migration problems? I need the correction to include figures in a report. I would be very happy if I could include the variogram figures with their nice labels.

Best regards,

Dimitri

Re: [SOLVED] Cross-variograms : variables labels on the plot

PostPosted: Fri Apr 27, 2018 12:58 pm
by Fabien Ors
Dear Dimitri,
The last RGeostats release has just been published.
Does it solved your problem ?
Best regards,
Fabien