[R] Need to study and learn about better plots

Gabor Grothendieck ggrothendieck at gmail.com
Thu Jul 2 17:38:31 CEST 2009


plot.zoo and xyplot.zoo in the zoo package both produce
multipanel plots with one panel per series (or optionally
all on one panel or a mixture).

library(zoo)
example(plot.zoo)
example(xyplot.zoo)

and see the three zoo vignettes.

The quantmod package has charting specifically oriented to
securities.

On Thu, Jul 2, 2009 at 10:39 AM, Mark Knecht<markknecht at gmail.com> wrote:
> Hi,
>   So far my plotting needs have been sort of ignored as I got
> acquainted with R this week, but now that I have the basics in place
> for the program I wanted to write  it's time for me to start learning
> about how to make output that better suits my needs. I think I have
> two sort of charts I need to concentrate on learning how to produce:
>
> 1) Probably a trivial request - a single chart that has multiple lines
> on it in different colors. I might have 500 to 1000 lines, all
> starting at 0,0 on the left  and proceeding to the right where they
> end either above 0 or below 0. There will groups of colors depending
> on the group they are part of. I'd like a legend on the right or
> bottom that explains the colors. I should be able to add or remove
> lines at any time.
>
> 2) The closest example of the second would be a multi-study chart sort
> of like is typical in a lot of stock charting programs. Here's (I
> hope) a simple example:
>
> http://stockcharts.com/h-sc/ui?s=BAC
>
> I'm not going to plot stock price data, or don't plan to anyway, but
> the thing I need in a chart is this multi-study aspect - essentially 3
> charts in the example, all sitting on top of each other, with their
> own axises. It might not be immediately clear that the link shows an
> upper chart with two parts - the price data (with volume and moving
> averages) and the uppoer portion that has an RSI indicator - in
> separate studies on the same chart, with a second chart immediately
> below it that has the MACD indicator.
>
>   With all the great plots I've seen so far I suspect these requests
> are pretty easy for the experts so I'm hoping for a few good ideas and
> maybe a few examples somewhere to help me get started will be all I
> need.
>
>   Keep in mind I've not used any command other than plot() and par()
> so far. I *very* new to this. I started looking at ggplot2 last night.
> I haven't looked at Lattice.
>
>   Any recommendations on where I should look next are warmly appreciated.
>
> Thanks,
> Mark
>
> ______________________________________________
> 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.
>




More information about the R-help mailing list