필터 지우기
필터 지우기

How can I merge the plot using the same x axis and y axis?

조회 수: 6 (최근 30일)
Kittiwat Kamlungsua
Kittiwat Kamlungsua 2020년 12월 28일
댓글: Adam Danz 2020년 12월 28일
Hi guys!
I want to ask how to merge the plot to be like this example (not mine, just get it from Google):
I tried using 'tiledlayout' command but it does not merge like the one I show. Do you have any ideas how? Thanks.

답변 (1개)

Cris LaPierre
Cris LaPierre 2020년 12월 28일
The closest MATLAB function I can think of is stackedplot. It's not exactly the same, but it's an easy way to get something close without having to put in a lot of manual effort.
Here's an example from the linked documentation page.
tbl = readtable('patients.xls');
stackedplot(tbl,{'Height','Weight','Systolic','Diastolic'})
  댓글 수: 1
Adam Danz
Adam Danz 2020년 12월 28일
To use one global ylabel,
h = stackedplot(rand(20,11));
% Get axis handles
ax = flipud(findobj(h.NodeChildren, 'Type','Axes'));
% Remove all ylabels
set([ax.YLabel],'String','')
% Set the middle ylabel
ax(floor(numel(ax)/2)).YLabel.String = 'Global Y Label';
ax(floor(numel(ax)/2)).YLabel.Rotation = 90;
ax(floor(numel(ax)/2)).YLabel.VerticalAlignment = 'Bottom';

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Formatting and Annotation에 대해 자세히 알아보기

태그

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by