[GRASSLIST:10736] Re: cannot put text in graphics in R

Roger Bivand Roger.Bivand at nhh.no
Sat Mar 4 14:20:48 EST 2006


On Sat, 4 Mar 2006, Carlos "Guâno" Grohmann wrote:

> > What class is variog1, which function made it, and from which package?
> >
> > plot() is a generic method, and dispatches on the class of its first
> > argument, so some changes have happened here - it turned out that three
> > different packages defined class variogram with different contents. We've
> > been trying to separate these, so that the wrong methods are not called.
> >
> > >
> 
> I made the variogram with gstat.
> > class(variog1)
> [1] "gstatVariogram" "data.frame"
> >

Yes, the plot method for this object now uses lattice/trellis graphics. 
You cannot overplot, but have to include all the additions you need in the 
plot() call. If you want base graphics, you can extract the values from 
the object:

plot(gamma ~ dist, variog1)

gives the variogram, and model= can be added with lines(), and you can add 
extra commands as before. However, lattice graphics are very powerful, and 
worth the trouble of learning, for example for displaying directional 
variograms.

Roger

> 
> If I just plot the variogram into the ps file, it goes well. the
> problem is with the text.
> 
> Carlos
> 
> 
> --
> +-----------------------------------------------------------+
>               Carlos Henrique Grohmann - Guano
>   Geologist M.Sc  - Doctorate Student at IGc-USP - Brazil
> Linux User #89721  - carlos dot grohmann at gmail dot com
> +-----------------------------------------------------------+
> _________________
> "Good morning, doctors. I have taken the liberty of removing Windows
> 95 from my hard drive."
> --The winning entry in a "What were HAL's first words" contest judged
> by 2001: A SPACE ODYSSEY creator Arthur C. Clarke
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no




More information about the grass-user mailing list