Graph Tips

Here are a some examples of creating graphs in Matlab designed to illustrate (i) importing data with getFredData, (ii) using plotly to make good-looking graphs, and (iii) different types of graphs. The first six examples all show off some different abilities of getFredData, after that they are solely about nice graphs with no new getFredData trick being used. Among the nice things about creating graphs in this way is that updating them to include new data is trivial (just change the end date and hit run).

  1. Graph of GDP and Potential GDP.
    (basic example of how to import from FRED and graph it with plotly)
  2. Changing Units (and multiple y-axes)
    (how to change units of data, eg. from level to growth rates)
  3. Data of Different Frequencies (eg. monthly & quarterly)
    (both using getFredData to change frequency, and how to plot two different frequency series on same graph)
  4. (forthcoming)
  5. Using Vintage (unrevised data) to create graphs showing how forecasts change with time.
    (learn to use ALFRED)
  6. Multiple Countries with a for-loop
    Rest are just about more advanced tricks with plotly, no new getFredData tricks.
  7. Stacking and Shading
  8. Multiple Graphs
  9. Recession Shading for time series graphs.
  10. Unofficial 10th is just a link to the documentation on plotly graph settings: plot.ly/matlab/reference/