How to change the marker symbol on the plots generated by anovan function?

7 次查看(过去 30 天)
For example:
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'};
[~,~,stats] = anovan(y,{g1 g2 g3},'model','interaction','varnames',{'g1','g2','g3'});
results = multcompare(stats,'Dimension',[1 2])
Would give me a plot like this:
ThreeWayANOVAMultipleComparisonsExample_02.png
How would I change those circle markers to dots?

采纳的回答

Walter Roberson
Walter Roberson 2020-1-26
The third output of multcompare is the figure handle of the figure it drew into. Assuming that you call that fig
ch = fig.Children(1).Children(); %children of the axes
marker_handles = ch(2:2:end);
Now you can
set(marker_handles, 'Marker', '.')
Unfortunately the dots will be nearly invisible unless you increase the marker size -- and if you do that, then you are essentially just doing a filled circle marker and instead of changing marker shape you should consider something similar to
set(marker_handles, {'MarkerFaceColor'}, get(marker_handles, 'Color'))
  5 个评论
Walter Roberson
Walter Roberson 2020-6-3
To change the marker size:
set(marker_handles, {'MarkerSize'}, num2cell(Vector_Of_New_Sizes))
Vector_Of_New_Sizes must have the same length as the number of marker handles.
Note: in the special case where you are setting them all to the same size then
set(marker_handles, 'MarkerSize', New_Size)

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by