[R-SIG-Finance] customizing format of yaxis annotation Performance Analytics
peter at braverock.com
Wed Feb 22 01:24:50 CET 2012
In the future, please post a reproducible example.
> chart.TimeSeries(managers[,1]) # Normal plot
> chart.TimeSeries(managers[,1], yaxis=FALSE)
> axis(2, at=pretty(managers[,1]), labels=sprintf("%s%%",
pretty(managers[,1]) * 100))
Is this what you're looking for?
> I am trying to change the format of my yaxis annotation for
> chart.TimeSeries (really chart.CumReturns and chart.Drawdown) from numeric
> decimal to a percentage.
> Something like:
> axis(2, at=pretty(y), labels=sprintf("%s%%", pretty(y) * 100)
> I have been looking for a solution all afternoon with no success. I saw
> nothing in the PerformanceAnalytics documentation. I tried suppressing the
> y-axis (yaxt='n') in chart.TimeSeries and then add my own custom y-axis.
> For my final effort,I copied the code from chart.TimeSeries and created my
> own custom.chart.TimeSeries by tweaking the yaxis code to accomplish my
> I would like to know if there is any elegant solution I am missing before
> pursue a more brute force method.
> Paul Ramer, CAIA
> PJR Investment Strategies, ltd.
> paul.ramer at gmail.com
> (303) 359-4192
> [[alternative HTML version deleted]]
> R-SIG-Finance at r-project.org mailing list
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions
> should go.
More information about the R-SIG-Finance