How to suppress axis labels in probplot

5 次查看(过去 30 天)
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