IoSR-Surrey / MatlabToolbox

General purpose Matlab toolbox
MIT License
126 stars 43 forks source link

How to change font size of legend? #12

Open shadowfox87 opened 5 years ago

shadowfox87 commented 5 years ago

I have a boxplot as follows:

ax=iosr.statistics.boxPlot(y,'showLegend',true);

ax.handles.legend.FontSize=10; %This line doesn't work even after changing it.

I even tried going into the function and adding set(obj.handles.legend,'FontSize',16); % in line 1977 (where the legend is created)

but all this does is make the legend box bigger, not the font..

chummersone commented 5 years ago

This is nothing to do with MatlabToolobox, but a well-documented shortcoming of recent Matlab versions. A potential solution here: https://mathworks.com/matlabcentral/answers/313678-how-do-i-change-the-font-in-my-legend-possible-bug

A quick search for matlab legend font size reveals other users who have had this issue.