Re: [R] A ggplot question

2009-12-02 Thread Matthieu Dubois
Hi Megh, just set the legned position to 'none' using options, by putting + opts(legend.position="none") after your code. ggplot(diamonds, aes(carat, ..density..)) + geom_histogram(binwidth = 0.2, aes(fill = cut)) + facet_grid(. ~ cut) + opts(legend.position="none") HTH, Matthieu __

Re: [R] A ggplot question

2009-12-02 Thread Megh
Hi all, I want be more clear what I want to do. Please consider following code : ggplot(diamonds, aes(carat, ..density..)) + geom_histogram(binwidth = 0.2, aes(fill = cut)) + facet_grid(. ~ cut) Here you see there is no need for the color-pallet named "cut", as the sub-plot headings take care of

Re: [R] A ggplot question

2009-12-01 Thread Megh
Thanks Ista for your mail. Here I wanted to have control on color-pallet. It is because, here my entire plot window is subdivided in 3 sub-plots horizontally, on basis if a factor-variable which contains three factors, using facet_grid(). Each sub-plot contains scatter-plot. I want to color the p

Re: [R] A ggplot question

2009-12-01 Thread Ista Zahn
There was a recent discussion of the ggplot2 mailing list about a similar issue. The first question is how will people know what the colors mean if you remove the legend? -Ish On Tue, Dec 1, 2009 at 11:41 PM, Megh wrote: > > Let consider following plot : > > p <- ggplot(mtcars, aes(mpg, wt)) >  

[R] A ggplot question

2009-12-01 Thread Megh
Let consider following plot : p <- ggplot(mtcars, aes(mpg, wt)) p + geom_point(colour="grey50", size = 4) + geom_point(aes(colour = cyl)) Now I want R to hide the color-pallet on "cyl", placed in the right edge completely. Can anyone please guide me how to do that? Thanks, -- View this me