Graphs

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Graphs

Postby Sophie » Thu Sep 08, 2016 12:47 pm

Dear all,

how can I receive more than 9 graphs in one window in the output? I would like to receive 10 variables all in the same format (height etc.), however Dynare gives me 9 and the 10th in a separate window very large. It proves to be very difficult to copy-paste this 10th graph into the same window with the others (using the plotting tool in Matlab) without having to shrink or delete one of the other IRF-graphs. Is there only space for 9 graphs?

Thanks a lot
Sophie
 
Posts: 8
Joined: Wed Jul 20, 2016 1:56 pm

Re: Graphs

Postby clara » Thu Sep 08, 2016 1:36 pm

you have to use subplot, for example:

subplot(4,3,1),plot(IRF.y_A,'-k','Linewidth',2)
title('output');
hold on

hope that can help you

Clara
clara
 
Posts: 31
Joined: Thu Jul 24, 2014 4:13 pm

Re: Graphs

Postby Sophie » Thu Sep 08, 2016 5:28 pm

Thanks a lot for this hint! I managed to get all 10 graphs at once using the subplot. However, they all start at a later point than 0 at the x-axis. Do you happen to know how I can make the impulse responses start from the y-axis instead of later? If you have them plotted using the mod-file they start from the y-axis so that there is no "gap".
Sophie
 
Posts: 8
Joined: Wed Jul 20, 2016 1:56 pm

Re: Graphs

Postby Sophie » Thu Sep 08, 2016 6:39 pm

I got it myself. For everyone who is wondering as well: The subplot-command has to be used after computing the mod-file output. Then, the normal Matlab functions can help a lot. In my example this was the solution (specifying start and end of axis):

subplot (4,3,1);
plot(y_eps_j,'k','LineWidth',1);
title('Output','fontweight','bold');
axis([1 10 -inf inf]);
axis 'auto y';
hold on;
subplot (4,3,2);
plot(cu_eps_j,'k','LineWidth',1);
title('Savers consumption','fontweight','bold');
axis([1 10 -inf inf]);
axis 'auto y';

etc....

Still thanks to Clara for giving the hint!
Sophie
 
Posts: 8
Joined: Wed Jul 20, 2016 1:56 pm


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 6 guests