1

I am trying to create a chart as shown below overlying the 10-year treasury bond yield (red line) against the 10-year forecast for the S&P 500 stocks (blue line). How would I plot both in the same plot? Here is an example of what I am trying to achieve: enter image description here

I retrieved the above figure from this post: http://jessefelder.tumblr.com/post/126106780155/the-warren-buffett-way-to-avoiding-major-bear

Oposum
  • 1,155
  • 3
  • 22
  • 38

1 Answers1

1

You can plot them together using ggplot:

    p <- ggplot() + geom_point(bonddata,aes(x,y))+
         geom_point(sp500data,aes(x,y))

This should get you started and you can use other ggplot functions for aesthetics. Check out this post for more information: How to combine 2 plots (ggplot) into one plot?

Community
  • 1
  • 1
a.powell
  • 1,572
  • 4
  • 28
  • 39