Re: [R] adding line to spinogram

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Mon 15 May 2006 - 23:13:00 EST

Package vcd is built on grid, not base graphics.

On Mon, 15 May 2006, Viktor Tron wrote:

> Dear all,
> I wonder what's special about spinograms {vcd} that prevents me from using
> it the way I do with other plots.
>
> I do:
>
>> spine(f.speaker.identity ~ x.log.lengthening,
>> data=ms,breaks=45,gp=gpar(fill=c("red","green")),xlab="length difference
>> (log ms)",ylab="speaker")
>> curve(0*x,add=T)
> Error in plot.xy(xy.coords(x, y), type = type, col = col, lty = lty, ...) :
> plot.new has not been called yet
>
>
> OK, if I do
>> curve(0*x,add=)
>> spine(f.speaker.identity ~ x.log.lengthening,
>> data=ms,breaks=45,gp=gpar(fill=c("red","green")),xlab="length difference
>> (log ms)",ylab="speaker")
>> curve(0*x,add=T)
>
> then the plot is what I want, but note that I had to use y=0 to get the
> line put at 0.5!!!! so it is already suspicious.
> But then:
>
>> dev.print(pdf,"mde_speakerration_by_lengthening.pdf")
> Error in dev.copy(device = function (file = ifelse(onefile, "Rplots.pdf",
> :
> invalid graphics state
>
> Can anyone suggest a remedy?

Use grid primitives to add to the plot.

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Mon May 15 23:17:15 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 17 May 2006 - 04:10:09 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.