Skip to content

timePlot legend

2 messages · ulasim77, Jim Lemon

#
Dear all

I am plotting a time series using time Plot function. All goes well until i
try to modify the legend by taking it from the standard location at the
bottom, to the right side in a vertical way. 

How can i do this?

This is my code:

filename <- sprintf('%s/TS_CO_all.png',folderPLOTS)
y_lab <- sprintf('CO (ug/m3)')
tit <- sprintf('EU Receptors 2010')
png(filename, width = 18 * 360, height = 9 * 360, res = 360, pointsize=240)
timePlot(data2,pollutant=models, group=TRUE, y.relation="same", avg.time
="month", 
         lwd = 3, ylab = y_lab, main = tit) #pLOT THE DATA AS IS
dev.off()

Best regards



--
View this message in context: http://r.789695.n4.nabble.com/timePlot-legend-tp4709366.html
Sent from the R help mailing list archive at Nabble.com.
#
Hi ulasim77,
At a guess, what you want is to move the legend from beneath the plot
to the right side. As none of the examples from the "plotTime"
function seem to work, I'll have to use something simpler:

par(mar=c(5,4,4,8))
plot(1:5)
legend(5.4,3.2,c("First","Second","Third"),lty=1:3,col=1:3,pch=1:3,xpd=TRUE)

Jim
On Fri, Jul 3, 2015 at 8:20 PM, ulasim77 <ulas at envs.au.dk> wrote: