[R-SIG-Finance] Plotting intraday time series with ggplot2

Jeff Ryan jeff.a.ryan at gmail.com
Tue Mar 30 16:00:50 CEST 2010


Not really a finance question, so that would explain the lack of
helpful replies.

Ask again on R-help.

For time-series plots, take a look at both plot.zoo and to a lesser
extent (less function, but different design) plot.xts.  You can coerce
most time-series with as.zoo or as.xts.

These two will utilize the underlying time index 'gaps'.

For something closer to financial charting software in R, take a look
at quantmod's chartSeries and unexported (so far) chart_Series.

http://www.quantmod.com/examples/

The site is getting a little dated, but the functionality is the same.
 These plots will not leave spaces (i.e. the ignore the time for all
but the axis labeling, and internal data alignment)

HTH
Jeff
On Tue, Mar 30, 2010 at 6:07 AM, Chris Masters
<christopher.masters at gmail.com> wrote:
> Hi
>
> I have a time series over n days of data observed at fixed intervals (m
> seconds) between 8:30am and 4:30pm and would like to plot this with ggplot2
> without the overnight gaps between 4:30pm and 8:30am. I have googled around
> quite a bit trying to see if I can have a disjoint x-axis but can't seem to
> come up with much. I also tried using scale_x_continuous for each day in the
> hope you could apply it multiple times to achieve this. I'd also like to
> label the x-axis with the dates of the days.
>
> Does anyone have any ideas? It seems like it should be a relatively simple
> to do but I'm afraid my ggplot2 knowledge is a bit thin
>
> Thanks
>
> Chris
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- 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.
>



-- 
Jeffrey Ryan
jeffrey.ryan at insightalgo.com

ia: insight algorithmics
www.insightalgo.com



More information about the R-SIG-Finance mailing list