[R] conditional plot

Chuck Cleland ccleland at optonline.net
Wed Jul 19 11:13:53 CEST 2006


Manoj wrote:
> Hi,
>      Can anyone pls help me in plotting the following data?
> 
>      The data-set contains company name, specification-1, specification-2.
> 
>      The graph would basically plot company name with specification-1
> on x-axis, & specification-2 on y-axis.
> 
>      Simply put - company name should get classified into one of the
> four quardrants created by specification 1 & specification2.

You could do something along these lines, replacing LETTERS with your 
company names:

df <- data.frame(SPEC1 = runif(26), SPEC2 = runif(26), COMPANY = LETTERS)

par(lab=c(10,10,7), las=1)
plot(df$SPEC1, df$SPEC2, type="n", xlab="Specification 1", 
ylab="Specification 2", ylim=c(0,1), xlim=c(0,1))
text(df$SPEC1, df$SPEC2, df$COMPANY)
axis(side=1, at = .5, tck=1, col="grey", lty=2)
axis(side=2, at = .5, tck=1, col="grey", lty=2)

> Thanks.
> 
> Manoj
> 
> ______________________________________________
> R-help at stat.math.ethz.ch 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.

-- 
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894



More information about the R-help mailing list