[R] Plotting (mixed) line types and legends
dunn at usq.edu.au
Mon Jul 28 09:00:32 CEST 2003
I have a question about plotting line types and
legends. Here's a short piece of code to
x <- y <- seq(1,10)
plot(x,y, type ="l", lty="33")
legend( 8,2,legend=c("lty=1","lty=\"33\""), lty=c(1,"33") )
On my system (see below), the line types in the legend
are not the same as in the plot--in particular, lty=1.
(In the plot, the lty=1 is solid as expected; in the
legend, it is dots close together.)
Is this because I shouldn't mix different ways of defining
line types in the legend? (ie stick to lty=c(1,2) only,
for example)? If so, I couldn't find it documented.
Any explanation appreciated. If anyone know hows to
do such a thing (ie define different line types in the
legend), I'd love to hear. (And yes, I need to do it--the
example above was a short snippet that just demos the problem.)
system i686, linux-gnu
Dr Peter Dunn (USQ CRICOS No. 00244B)
Email: dunn @ usq.edu.au
Opinions expressed are mine, not those of USQ. Obviously...
More information about the R-help