MATLAB: How to display greek letters as boxplot labels

boxplotslabelsMATLABtex

Dear all,
I am trying to plot several box plots and label each of them. Each of those labels also contains a greek character. When I use a normal line plot, I can easily change the labels to include greek characters, but with box plots the greek chracters are not displayed, but rather the tex command used to generate them. This is what I have tried:
Attempt 1:
figure
boxplot([[1:2:10]',[1:2:10]'],'Labels',{'A \lambda ', 'B \rho'})
h = findobj(gca, 'type', 'text');
set(h, 'Interpreter', 'tex');
%Attempt 2:
figure
boxplot([[1:2:10]',[1:2:10]'])
set(gca,'xticklabel',{'A \lambda', 'B \rho'},'fontsize', 14)
Neither attempt has worked.

Best Answer

Use ASCII codes
figure
boxplot([(1:2:10)',(1:2:10)'])
set(gca,'xticklabel',{['A ' char(955)], ['B ' char(961)]},'fontsize', 14)
% lambda rho
% or with capital letters
set(gca,'xticklabel',{['A ' char(923)], ['B ' char(929)]},'fontsize', 14)c
List of greek character ASCII codes