MATLAB: Customizing MATLAB Plots and Subplots

MATLABplotssubplots

In an economics paper (https://www.federalreserve.gov/econres/feds/files/2018043pap.pdf), all the plots have invisible top axis, with Y-axis values marked on the right hand side with the axis label on top of it, differently from they way MATLAB plots figures in which Y-axis values are marked on the left hand side and axis label is written beside it in a vertical manner.
If you see their figure 9, for instance, which has 4 by 3 subplots, they all share the aforesaid features. More importantly, each individual plot is longer than wider.
THEIR PLOTS
MATLAB PLOTS
I want to generate plots like theirs in MATLAB. I looked around and experimented but couldn't find a solution. Worse, I cannot even figure out which application they have used for all their figures, if it's not MATLAB. Will appreciate any help.

Best Answer

The new(ish) yyaxis function to arbitrarily create two y axes and then switch between left and right axes w/o the need of yyplot to have two separate plot() arguments is useful for such things. As Bjorn says, it's a lot of fine tuning; some of which just can't do with the default Matlab components--like you don't have the flexibility to move axes labels so you'll just have to do them manually.
Here's another very rough starting point---
yyaxis right % create two axes; RH axis has focus
hAx=gca; % get a handle (YAxis property is the two axes handles)
hAx.YAxis(1).TickLabel=[]; % don't show labels on LH axis
set(hAx.YAxis,{'Color'},{'k'}) % use sedate color...
hTx=text(1,1,'Percent of GDP','HorizontalAlignment','right','VerticalAlignment','bottom');
produces
which has most of the features other than the partial box besides the tick marks at the top. You can always simulate this by line if it's important enough.
ADDENDUM
With Steven L's "gotcha!" comment, the above can be generated by using
hRYlab=ylabel('Percent of GDP','Position',[1 1],'HorizontalAlignment','right', ...
'VerticalAlignment','bottom','Rotation',0);
Since it's a Y-axis label, Matlab by default writes it vertically so have to override that with the 'Rotation' parameter even tho is the default for a text() object....
Definitely better to use the axes properties and the access via x/ylabel() functions beats having to go handle-diving inside the axes object for hidden properties from its viewpoint.
My bad for not having carried through and written a label and probed it instead of jumping to the wrong conclusion regarding visibility -- have to admit in 30 yrs, don't know I've ever done anything to an axis label but change font size or the like, though.