Hi I would like to thank Klaas for his quick answer, this might help many of
you considering the function axis.rendre is not intended to be called by
users.
<Klaas>
Yep, it can be done:
plot(timeSeries(data= data.frame(x = 11:20, y = 21:30), from="1/1/98" )
, yaxt = 'n')
## x
axis.render(side = 2,
ticks = list(at = 21:30),
labels = list(at = 21:30, text = paste("$", 21:30, sep = ""),
col = 2, cex = 1.2, line = 2)
)
## y
axis.render(side = 2,
ticks = list(at = 11:20),
labels = list(at = 11:20, text = paste("$", 21:30, sep = ""),
col = 3)
)
eggraid wrote:
>
> Hi, Im plotting timeSeries and I would like to include a dollar sign to
> the values on the y axis. It seems imposible to have factors for the data
> part of a timeSeries object and I just can't find the right way to use
> "paste" in the labels argument of the axis function.
> here's a look at my code, please, any help would eb appreciated.
>
> par(oma=c(2,0,0,5))
> tmp1<-seriesMerge(tmp,tmp[(nrow(tmp)-39):nrow(tmp)],tmp2,tmp2[(nrow(tmp2)-39):nrow(tmp2)],pos="union")
> datesTick<-match(c(1980,1990,2000,2008,2016),years(tmp1@positions))
> plot(tmp1[,3:4]*100,reference.grid=F,plot.args=list(col=c(orange,3),lwd=2),axes=F)
> axis(2,ticks=F,las=1)
> key(0.25,-5.5,text=c("PIB en PPP per capita","Croissance du PIB per
> capita"),lines=list(col=c(bleu,orange),lwd=2))
> par(new=T)
> plot(tmp1[,1:2],plot.args=list(col=c(tonbleu2,bleu),lwd=c(2,4)),reference.grid=F,axes=F)
> axis(4,ticks=F,las=2,labels=log(tmp1[,1]))
> axis(1,at=datesTick/nrow(tmp1),labels=years(tmp1@positions[datesTick])
> ,ticks=F)
>
--
View this message in context:
http://www.nabble.com/have-currencies-on-one-axis-for-a-plot.timeSeries-tp14297840p14298288.html
Sent from the S-News mailing list archive at Nabble.com.
|