How to suppress axis labels in probplot

6 Ansichten (letzte 30 Tage)
Branko Celler
Branko Celler am 30 Mär. 2015
Beantwortet: Branko Celler am 2 Apr. 2015
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?

Antworten (3)

Vinod Sudheesh
Vinod Sudheesh am 1 Apr. 2015
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 am 1 Apr. 2015
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 am 2 Apr. 2015
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','')

Kategorien

Mehr zu Graphics Object Properties finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by