필터 지우기
필터 지우기

How to increase text size for asterisk for significant data

조회 수: 8 (최근 30일)
Pushti Shah
Pushti Shah 2023년 7월 10일
댓글: Pushti Shah 2023년 7월 10일
I am using the function sigstar, which helps make significance bars for data. An example of the code is:
R=randn(30,2);
R(:,1)=R(:,1)+3;
boxplot(R)
set(gca,'XTick',1:2,'XTickLabel',{'A','B'})
H=sigstar({{'A','B'}},0.01);
ylim([-3,6.5])
set(H,'color','r')
I want to increase the size of the asterisks that form on top of the bars. Does anyone know how to do this?
Attached above is an example of the bar graph I made.
I have tried the following code and here is the error:
>> set(H,'color','r','LineWidth',1,'TextSize',12)
Error using set
Unrecognized property TextSize for class Line.

채택된 답변

Voss
Voss 2023년 7월 10일
R=randn(30,2);
R(:,1)=R(:,1)+3;
boxplot(R)
set(gca,'XTick',1:2,'XTickLabel',{'A','B'})
H=sigstar({{'A','B'}},0.01);
ylim([-3,6.5])
Note, from the help comment at the top of sigstar:
% Outputs
% H - optionally return handles for significance highlights. Each row is a different
% highlight bar. The first column is the line. The second column is the text (stars).
Therefore, e.g.:
% set the line color and linewidth:
set(H(:,1),'color','r','LineWidth',1)
% set the text fontsize:
set(H(:,2),'FontSize',22)
  댓글 수: 1
Pushti Shah
Pushti Shah 2023년 7월 10일
Thank You! I just solved this problem using by changing the original function sigstar.m and changing it there but this works too thank you very much!

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

추가 답변 (1개)

Aniketh
Aniketh 2023년 7월 10일
The correct parameter for matlab plots is 'FontSize'
  댓글 수: 1
Pushti Shah
Pushti Shah 2023년 7월 10일
yeah that didn't work either it gave the same error because I was calling the line. Thank you for helping!

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

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by