Change title in anovan boxplot

조회 수: 14 (최근 30일)
Ahmad Rg
Ahmad Rg 2021년 2월 17일
댓글: Ahmad Rg 2021년 2월 18일
Hi all, is there any way to change the title of table in the N-way anova figure? For example, for the below case I would like to change "Analysis of Variance" to "Anova Table". Any help would be appreciated.
y = [52.7 57.5 45.9 44.5 53.0 57.0 45.9 44.0]';
g1 = [1 2 1 2 1 2 1 2];
g2 = {'hi';'hi';'lo';'lo';'hi';'hi';'lo';'lo'};
g3 = {'may';'may';'may';'may';'june';'june';'june';'june'};
p = anovan(y,{g1,g2,g3})

채택된 답변

Adam Danz
Adam Danz 2021년 2월 18일
편집: Adam Danz 2021년 2월 18일
% Generate table
y = [52.7 57.5 45.9 44.5 53.0 57.0 45.9 44.0]';
g1 = [1 2 1 2 1 2 1 2];
g2 = {'hi';'hi';'lo';'lo';'hi';'hi';'lo';'lo'};
g3 = {'may';'may';'may';'may';'june';'june';'june';'june'};
p = anovan(y,{g1,g2,g3});
% Change heading
headingObj = findall(0,'Type','uicontrol','Tag','Heading');
headingObj(1).String = 'ANOVA table'; % See note
Note: if multiple ANOVAN tables exist, headingObj will be a vector of handles. To change the heading of the most recently created table, use headingObj(1).String='...'. To change the heading of all existing tables, use set(headingObj,'String','...').
  댓글 수: 3
Adam Danz
Adam Danz 2021년 2월 18일
편집: Adam Danz 2021년 2월 18일
Glad I could help.
I just updated the answer so that it works when multiple anovan tables exist and simplified the solution by eliminating one line of code.
Ahmad Rg
Ahmad Rg 2021년 2월 18일
Much appreciated!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Analysis of Variance and Covariance에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by