Doubleaxes XX and YY with tiled layout

2 views (last 30 days)
juan sanchez
juan sanchez on 22 Dec 2021
Commented: Dave B on 22 Dec 2021
How can we do a xx and yy axis on both of these charts. How do we keep control of the positions of the tile in case I want to add xlabes and ylabes. In subplot was fairly simple to do subplot(m,n,position) but here is kind of tricky.
p = uipanel('Position',[.1 .2 .8 .6]);
t = tiledlayout(p,2,1);
% Tile 1
nexttile(t)
stem(1:13)
% Tile 2
nexttile(t)
bar([10 22 31 43 52])
  1 Comment
Dave B
Dave B on 22 Dec 2021
@juan sanchez - can you clarify a little bit what you're trying to accomplish? The first bit seems like you want the effect off yyaxis but for x axes (which isn't something that MATLAB does out of the box but it's possible to fake it), but then the second bit looks like you're just trying to grab a handle to the axes that nexttile makes which is pretty easy (nexttile really does the same as subplot but you don't have to specify the grid size). If you clarify a bit I can give you a good answer either way.

Sign in to comment.

Answers (0)

Categories

Find more on Axes Appearance in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!