Greek letters and label alignment in boxplot graph
4 次查看(过去 30 天)
显示 更早的评论
Hello,
in three slightly different models I have calculated the results for the same 5 sets of parameter combinations and would like to display the results in a boxplot graph. This works so far well but the tick-labeling of the x-axis does not look nice for two reasons:
1) I cannot get the labels to show the real greek symbols
2) It would probably look nicer if the parameter set label (Base Case, etc.) would either be centered under the three respective graphs or at least left aligned with "M1"
Would be very thankful for any hints or advice!
Best regards
Christian
Here is the code as well as the graph it produces:
% Output of models: first column are results for 10.000 simulations of first parameter set,
% second column results of 10000 simulations of second parameter set, etc.
Model_1 = rand(10000,5);
Model_2 = rand(10000,5);
Model_3 = rand(10000,5);
DataforBoxplot = cat(2,Model_1, Model_2, Model_3); % Combine model data in one matrix
figure('units','normalized','outerposition',[0 0 1 1])
Parameterset = repmat({'Base Case' 'Case \alpha' 'Case \beta' 'Case r' 'Case \gamma'},1,3);
Modellabel = [ repmat({'M1'},1,5) , repmat({'M2'},1,5) , repmat({'M3'},1,5) ];
boxplot(DataforBoxplot, {Parameterset, Modellabel}, 'factorgap', [10 0], 'labelverbosity', 'minor')
title('Example graph')
ylabel('Model output')
xlabel('Model (1-3) and parameter set used')
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/152172/image.jpeg)
0 个评论
采纳的回答
Thorsten
2015-11-25
To get Greek letters
Parameterset = repmat({'Base Case' ['Case ' char(945)] ['Case ' char(946)] 'Case r' ['Case ' char(947)]},1,3)
6 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Labels and Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!