[R] reduce the size of points in plot???

Joshua Wiley jwiley.psych at gmail.com
Sat Oct 16 23:38:47 CEST 2010


Hi Gary,

On the off chance you want to reduce size to reduce over-plotting, you
can also use semi-transparent colors (otherwise this is completely
irrelevant to you):

# Open and setup new graphics device
dev.new(); exampledev <- dev.cur(); par(mfcol = c(1, 2))
# Regular color
plot(x = Ex <- sample(15, 1000, replace = TRUE), y = Ey <- rnorm(1000),
     pch = 20, col = rainbow(1, alpha = 1))
# Semi-transparent color to alleviate over-plotting
plot(x = Ex, y = Ey, pch = 20, col = rainbow(1, alpha = .4))
# Clean up and shutdown
rm(Ex, Ey); dev.off(exampledev)

Cheers,

Josh

On Sat, Oct 16, 2010 at 12:12 PM, Hongwei Dong <pdxdong at gmail.com> wrote:
> Hi, R users,
>
> Can anyone tell me how I can change the size of points in my plot?
>
> For example:
>
> x <- c(1,3,6,9,12)
> y <- c(1.5,2,7,8,15)
> plot(x,y,pch=20)
>
> How do I reduce the size of those points?
>
>
> Thanks.
>
> Gary
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/



More information about the R-help mailing list