How to suppress axis labels in probplot

조회 수: 6 (최근 30일)
Branko Celler
Branko Celler 2015년 3월 30일
답변: Branko Celler 2015년 4월 2일
I am printing a probplot on multiple subplot(9,3,!) on the same page to check the distribution of a number of datasets. The automatically generated X and Y axis labels are simply a nuisance as they repeat for each subplot and overlap making a very messy plot. I can use the text command to describe the overall plot. Is there any way that I can suppress the writing of X and Y axis labels every time that I call the probplot function in matlab?

답변 (3개)

Vinod Sudheesh
Vinod Sudheesh 2015년 4월 1일
You could do this by setting the "axes" properties appropriately. For example, please see the code snippet below in which the "XTick","YTick","XTickLabel", "YTickLabel","Title","XLabel" and "YLabel" properties of the axes that corresponds to the probability plot created using the "probplot" function is suppressed.
figure()
subplot(2,2,1)
plot(1:10);
subplot(2,2,2)
plot(1:10);
subplot(2,2,3)
plot(1:10);
y = exprnd(5,200,1);
probplot(y);
set(gca,'XTick',[]);
set(gca,'YTick',[]);
set(gca,'XTickLabel',[]);
set(gca,'YTickLabel',[]);
set(gca,'Title',[]);
set(gca,'XLabel',[]);
set(gca,'YLabel',[]);
subplot(2,2,4)
plot(1:10);
Please refer to the following documentation page for more information on "axes" properties.

Branko Celler
Branko Celler 2015년 4월 1일
This does not appear to work and generates and error. Please see below;
for i=1:N subplot(3,9,i) probplot('normal',BEFORE(:,i,j))
% script below added as suggested
set(gca,'XTick',[]); set(gca,'YTick',[]); set(gca,'XTickLabel',[]); set(gca,'YTickLabel',[]); set(gca,'Title',[]); set(gca,'XLabel',[]); set(gca,'YLabel',[]);
Generated error;
Error using set Invalid object handle Error in PlotDHS_150402 (line 54) set(gca,'Title',[]);
However axis tics were supressed, before error stopped the processing!

Branko Celler
Branko Celler 2015년 4월 2일
Title, XLabel and YLabel are treated differently; the script below works in supressing Axes Ticka and Labels set(gca,'XTick',[]); set(gca,'XTickLabel',[]); set(gca,'YTick',[]); set(gca,'YTickLabel',[]); set(get(gca,'XLabel'),'String','') set(get(gca,'YLabel'),'String','') set(get(gca,'Title'),'String','')

카테고리

Help CenterFile Exchange에서 Graphics Object Properties에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by