Dear all

I have the following code to produce a graph of 5 different variables in the same graph; however when I follow it in the end it produces the plot of the 5 variables and a legend in right but the problem is that the legend is too close to the margin of the plot and when I try to write the text for each line it does not fit. How can I change the location of the legend to be placed a little bit to the left?

example<-read.csv(file="example.csv")
example$date<-as.Date(example$Date,format="%d/%m/%Y",order="dmy")
head(example)
str(example)
names<-names(example)[2:5]
examplelong <- reshape(example, idvar = "id", varying = list(names), v.names="outcome",direction = "long")
examplelong$time2<-factor(examplelong$time,labels=rep("   ",4))
d3<-c((examplelong$date[1]),(examplelong$date[103]))
d4<-as.Date((d3[1])+150*(0:20))
interaction.plot(examplelong$date, examplelong$time2,examplelong$outcome,xaxt="n",type="l",pch=20,xlab="", log="y", ylab=expression(paste(Concentration~(~mu~g/L))), trace.label="",col=rainbow(4))

Thank you
Maria

	[[alternative HTML version deleted]]

