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')
댓글 수: 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!