[R] divided scatter plots

Jim Lemon jim at bitwrit.com.au
Wed Aug 22 11:23:32 CEST 2007

Caroline Nganga wrote:
> I have a data set which contains two columns. The first column is a
> list of countries, and the second column contains their political risk
> ratings. I would like to create  one large plot that contains 5
> different sections, each with a scatter plot. To clarify, I have
> divided the countries into 5 groups. For each group (continent), I
> would like to have the name of the continent on the x-axis, and points
> representing countries and  their risk rating on the y-axis. However,
> I want all 5 scatter plots to be in one large plot. What function
> should I use to do this? Also, is it possible to label each point?
> thanks for any help!
Hi Caroline,
If I understand your request, you might be able to use the axis.break 
function in the plotrix package. That is, you make one big plot with the 
points in five columns and then put gap style axis breaks between the 
columns. Here's a toy example:

plot(prr.df$continent,prr.df$prr,main="Political risk ratings",
  xlim=c(0.7,5.3),xlab="Continent",ylab="Risk rating",type="n")


More information about the R-help mailing list