Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

one ylabel for all subplots matlab

How can set a 'big, single' ylabel for multiple subplot figure in matlab?

I tried to search but only found a similar question with 'matplotlib' not with matlab.

Thanks in advance.

like image 359
Mushi Avatar asked Oct 02 '22 21:10

Mushi


1 Answers

Here something that could help you:

MyBox = uicontrol('style','text');
set(MyBox,'String','Your YLabel')
set(MyBox,'Position',[0,0,10,10])

You can add other properties to rotate it and change the background color.

Edit:

Well i didn't find any ways of doing the rotation with the uicontrol. The other option is to use the text command :

%your subplot
h = axes('Position',[0 0 1 1],'Visible','off'); %add an axes on the left side of your subplots
set(gcf,'CurrentAxes',h)
text(.1,.45,'Your YLABEL',...
'VerticalAlignment','bottom',...
'HorizontalAlignment','left', 'Rotation', 90, 'FontSize',18)
like image 50
m_power Avatar answered Oct 12 '22 11:10

m_power