# Set your working directory # then remove the "#" in front of the setwd line #setwd("your working directory here") # Read the data myData<-read.csv("compensation.csv") # Different color for different treatment culr <- ifelse(myData$Grazing == "Grazed", 1, 4) # The main figure # pch is for the point type # cex is for the size plot(myData$Root,myData$Fruit, xlab="Root stock width", ylab="Fruit production", pch=culr,cex=2) # Legend, coordinate the color with the main figure legend("topleft", legend=c("Grazed","Ungrazed"), pch=c(1,4), pt.cex=2)