creating legend with only string
9 views (last 30 days)
ylabel('Number of Measurement')
h_x = legend([':mean (cm)=' num2str(mean_x)], 'Location','NorthEast');
How can I delete the blue box left near to "mean (cm)=" string in figure to display only string?
Pham Dang on 11 Aug 2016
Hi, you should consider using the annotation command. Add these commands after yours :
annotation('textbox',get(h_x,'Position'),'String',['mean (cm)=' num2str(mean_x)])
The first command places the text box at the same position of the legend ; the second hides the legend.