フィルターのクリア

One common Y-axis label for two or more plots

4 ビュー (過去 30 日間)
monkey_matlab
monkey_matlab 2015 年 11 月 13 日
回答済み: Madhu Govindarajan 2015 年 11 月 13 日
Hello,
How can I get just one Y-Axis Label to span two or more plots? That is, center the Y-axis label between the plots in the rows?
Here is my code:
FigH = figure;
subplot(2,1,1); subplot(2,1,2);
AxesH = findobj(FigH, 'Type', 'Axes');
YLabelHC = get(AxesH, 'YLabel');
YLabelH = [YLabelHC{:}];
set(YLabelH, 'String', 'Y-label')
TitleHC = get(AxesH, 'Title');
TitleH = [TitleHC{:}];
set(TitleH, 'String', 'The title');

採用された回答

Madhu Govindarajan
Madhu Govindarajan 2015 年 11 月 13 日
I would propose you to get the Handle of the subplots and then work with that.
Sample code
FigH = figure;
SP1H = subplot(2,1,1);
SP2H = subplot(2,1,2);
YLabel1H = get(SP1H,'YLabel');
set(YLabel1H,'String','YLabelThatIWant');
set(YLabel1H,'Position',[-0.0542 0 0]);
Title1H = get(SP1H,'Title');
set(Title1H,'String','TheTitleThatIWant');
HTH

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

タグ

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by