search for: legnames

Displaying 3 results from an estimated 3 matches for "legnames".

Did you mean: argnames
2010 Feb 03
1
legend help
i=1 for(rate in c(2,4) ){ for(shape in c(1,3,5) ){ curve(dgamma(x,rate,shape),xlim=c(0,3),ylab="",col=i,lty=i,add=T) i=i+1 } } How can I add some legend to represent these lines? i.e. the legend is displayed as col=1 lty=1 lambda=2 theta=1 col=2 lty=2 lambda=2 theta=3 col=3 lty=3 lambda=2 theta=5 col=4 lty=4 lambda=4 theta=1 col=5 lty=5 lambda=4 theta=3 col=6 lty=6 lambda=4 theta=5
2006 Mar 02
2
'...' passed to both plot() and legend()
Dear R-devels, I'd like to create a plot method for a class of objects that passes the '...' argument to both plot() and legend(), e.g., x <- list(data = rnorm(1000)) class(x) <- "foo" plot.foo <- function(x, legend = FALSE, cx = "topright", cy = NULL, ...){ dx <- sort(x$data) plot(dx, dnorm(dx), type = "l", ...) if (legend)
2010 Mar 02
3
Keeping the order of data set when plotting
I have a data frame with 3 columns and I want to order the entire list by one column and then plot. I used order() and it does order the data set but when I plot it is as if the set is as it was originally. I also can't figure out how to plot two sets of data on the same graph. I have, Occupation American.Workers Foreign.Workers Accountant 12 2 Engineer 45 54 Doctor 50 37 I want