Hi all, I'm a newbie to R and it has been very helpful to use your website. Unfortunately I've been struggling with my code now for two days so I wanted to ask few questions. I've been trying to create nice graphs to put into a pdf sheet but I'm having little problems with all the packages I've been using. So what I want to accomplish is create one pdf sheet with three graphs and one correlation table. Attached is an example I created which is very similar to what I want to do but there are few things I would like to change. I'm using chartSeries in quantmod for the graphs and for the table I'm using textplot. Few questions: 1) Is it possible to remove the date in the upper right corner of the graphs? 2) Instead of the text Last xxxx (the green series) I would like to get the name of the series itself, e.g. Stock 1, is that doable? 3) How can I give the axes names, e.g. Return, Date? 4) In the Cumulative Difference graph I'm using the addVo() and that function gives this nice barPlot. In the other graphs I'm not using addVo() just addTA and type='h' and you can see the difference of the bar/histogram plots. Is it possible to get the same plot using addTA as in addVo? 5) What is the best way to fit the correlation table nicely in the file and maybe also set the number of digits? I've also been trying to use plot.zoo because it is easier to work with the chart but it seems like impossible to get all the graphs into one page in pdf similar to the attached file. The graphs always display on separate pages. I've tried layout, which works for quantmod, and par(mfrow=), which works for regular plots, but neither seem to work for plot.zoo. What is the right way to do this? http://r.789695.n4.nabble.com/file/n4638057/TestGraph.pdf TestGraph.pdf I appreciate your help. Best, OTB -- View this message in context: http://r.789695.n4.nabble.com/Working-with-quantmod-chartSeries-and-plot-zoo-tp4638057.html Sent from the R help mailing list archive at Nabble.com.
Gabor Grothendieck
2012-Jul-27 10:30 UTC
[R] Working with quantmod chartSeries and plot.zoo
On Fri, Jul 27, 2012 at 1:21 AM, OTB <olibirgis at gmail.com> wrote:> Hi all, > > I'm a newbie to R and it has been very helpful to use your website. > Unfortunately I've been struggling with my code now for two days so I wanted > to ask few questions. I've been trying to create nice graphs to put into a > pdf sheet but I'm having little problems with all the packages I've been > using. So what I want to accomplish is create one pdf sheet with three > graphs and one correlation table. Attached is an example I created which is > very similar to what I want to do but there are few things I would like to > change. I'm using chartSeries in quantmod for the graphs and for the table > I'm using textplot. Few questions: > > 1) Is it possible to remove the date in the upper right corner of the > graphs? > 2) Instead of the text Last xxxx (the green series) I would like to get the > name of the series itself, e.g. Stock 1, is that doable? > 3) How can I give the axes names, e.g. Return, Date? > 4) In the Cumulative Difference graph I'm using the addVo() and that > function gives this nice barPlot. In the other graphs I'm not using addVo() > just addTA and type='h' and you can see the difference of the bar/histogram > plots. Is it possible to get the same plot using addTA as in addVo? > 5) What is the best way to fit the correlation table nicely in the file and > maybe also set the number of digits? > > > I've also been trying to use plot.zoo because it is easier to work with the > chart but it seems like impossible to get all the graphs into one page in > pdf similar to the attached file. The graphs always display on separate > pages. I've tried layout, which works for quantmod, and par(mfrow=), which > works for regular plots, but neither seem to work for plot.zoo. What is the > right way to do this? > http://r.789695.n4.nabble.com/file/n4638057/TestGraph.pdf TestGraph.pdf > > I appreciate your help. > > Best, > OTB > > > > -- > View this message in context: http://r.789695.n4.nabble.com/Working-with-quantmod-chartSeries-and-plot-zoo-tp4638057.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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.Please read the last line to every post on r-help and note the part about reproducible code. -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com