Skip to content
Prev 275385 / 398506 Next

Plot Legend

Are you sure you are using the data set mtcars? That data set doesn't
have variables Na or K nor does it look like what you provided...

For the real mtcars, you could try this which I think does something
like what you want.

with(mtcars, plot(cyl, mpg, pch = carb, col = gear))
with(mtcars, legend("top", legend = unique(carb), pch = unique(carb)))
with(mtcars, legend("bottom", legend = unique(gear), pch = 20, col =
unique(gear)))


Michael
On Mon, Oct 24, 2011 at 6:21 AM, RMSOPS <ricardosousa2000 at clix.pt> wrote: