combining 3 graphs from different codes.
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am trying to replicate a model that corresponds to the New Keynesian model used in Leeper, Traum and Walker (2017). There is a .mod file where I am changing the parameters and there is a .m file that runs the .mod file using dynare, combines the 40 graphs in the .mod file and subplots 12 output into 1 graph.
My problem is, I have 2 other modified version of the .mod file, so I want to combine the result of these 2 graphs over the 1st graph so that they are comparable.
0 commentaires
Réponse acceptée
Voss
le 9 Juil 2023
Try the modified run.m file attached. I added a for loop to loop over the three .mod files (you'll have to supply their names), runnning dynare on each and plotting each set of results into the same 12 subplots, with a different line color for each model. After the for loop, the other stuff you're doing (setting the subplot title, adding a horizontal line at y=0, setting axis tight) is done once for each subplot.
You may want to add (a) legend(s) to indicate which lines correspond to each model. Since the legend would be the same for each of the 12 subplots, it makes sense to have one legend for all subplots instead. To do that, you can use tiledlayout instead of subplot, as shown here, or do it with subplots as shown here.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Discrete Data Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!