2017-03-09 1 views
1

나는 줄거리를 얻기 위해 다음과 같은 루프를 사용했다 : 모든 줄거리를 들어서브 플로트의 경우 모든 x 축과 y 축에 공통 라벨을 붙이는 방법은 무엇입니까?

for j=1:19; 
    Aj=B(j,:); 
    subplot(5,4,j); 
    plot(Aj,h) 
end 

, 나는 단 하나의 X-라벨 한 Y-라벨이 필요합니다. 이 작업을 수행하는 방법? 또한 모든 하위 플롯에 범례를 삽입하는 방법은 무엇입니까? 당신은 FileExchange에서 suplabel을 사용할 수 있습니다

답변

2

를 조합 한 것으로 XY 모든 줄거리에 대한 레이블입니다.

예 :

subplot(1,2,1); 
plot(randperm(40)); hold on; plot(randperm(40)); %Plotting some random data 
legend('show') %To show the legend 

subplot(1,2,2); 
plot(randperm(40)); hold on; plot(randperm(40)); %Plotting some random data 
legend('show') %To show the legend 

%Using suplabel from the FileExchange to give a single x and y label for all subplots 
suplabel('Combined X label','x'); 
suplabel('Combined Y label','y'); 

출력 :

outputsuplabel


은 가끔 볼 수있는 그림 창을 최대화해야하는 xlabel 때 우리를 ing suplabel.

관련 문제