[R] Alter plot point size by value of the plot value

Jonathan P Daily jdaily at usgs.gov
Fri Dec 17 19:10:05 CET 2010


Assuming your plot values are X and Y:

cex.val <- 1 + (Y < 1E-6)*.5 - (Y > 1E-3)*.5
plot(X, Y, cex = cex.val)

--------------------------------------
Jonathan P. Daily
Technician - USGS Leetown Science Center
11649 Leetown Road
Kearneysville WV, 25430
(304) 724-4480
"Is the room still a room when its empty? Does the room,
 the thing itself have purpose? Or do we, what's the word... imbue it."
     - Jubal Early, Firefly

r-help-bounces at r-project.org wrote on 12/17/2010 11:58:07 AM:

> [image removed] 
> 
> [R] Alter plot point size by value of the plot value
> 
> Douglas Scheftner 
> 
> to:
> 
> r-help
> 
> 12/17/2010 12:00 PM
> 
> Sent by:
> 
> r-help-bounces at r-project.org
> 
> R folks,
> 
>   I am trying to create a mhtplot plot that will alter the point 
> size via the plot point value.    The size of the point should 
> change via a set criteria such as:
> 
> if  point value <10^-6 size 3x
> else if 10^-3> point value >10^-6 size 2x
> else point value >10^-3 size is x
> 
> I consider myself an R newbie, and I am assuming that I could do 
> this via some sort of function to change the parameter cex value of 
> the plot, but I do not even know where to begin.  I have searched 
> for something similar to this, but have not had any luck.  Is it 
> possible to write a function that will alter the cex value via the 
> plot value.  Any suggestions?
> 
> Thanks in advance,
> Doug
> 
> ______________________________________________
> 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.



More information about the R-help mailing list