On Tue, Nov 9, 2010 at 12:41 PM, patrick nguyen <patrickqngu...@yahoo.com> wrote: > Hi > > > I'm having problems displaying multiple chart.StackedBar from > PerformanceAnalysis library on a single plot. I've tried using
I am assuming you mean the PerformanceAnalytics package, at least that is what I will talk about. > par(mfrow=c(2,1)) but that doesn't work. > > If I do it with barplot(), it works fine and I see both plots on a single > plot. > >> plot(mfrow=c(2,1)) >> barplot(blahblah) >> barplot(blahblah) this works because barplot() just plots in the device opened by the call to par() (well, what would have been the call to par()) > > However if I try to use chart.StackedBar, the second entry appears to just > overwrite the window. > >> plot(mfrow=c(2,1)) >> chart.StackedBar(blahblah,date.format="%H:%M:%S",las=2, >>colorset=rainbow12equal) >> chart.StackedBar(blahblah,date.format="%H:%M:%S",las=2, >>colorset=rainbow12equal) The issue here is that chart.StackedBar calls par() itself, so it is overriding your settings. This will not be terribly easy to change. My guess is that you would have to alter the function itself. However, if you simple delete/comment its par call, there will likely be clipping issues with the fancy legend that it seems to add. If you provide data and exactly what it is you want (so for instance I know whether chart.StackedBar is being dispatched to the .xts or .matrix side) I might edit the function for you. Alternately you could just live with them separate and merge them in your paper or presentation or whatever. Just use the xlim and ylim arguments so they are on the same scale. Cheers, Josh > > Any suggestions are greatly appreciated! > > -patrick > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Joshua Wiley Ph.D. Student, Health Psychology University of California, Los Angeles http://www.joshuawiley.com/ ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.