How to insert Xlabel and Ylabel into axes when designing GUI ?

31 ビュー (過去 30 日間)
Yunsung Kim
Yunsung Kim 2011 年 12 月 8 日
回答済み: Hengameh Noshahri 2015 年 10 月 14 日
I made 2 axes by GUI design.
And i want to insert X,Y label into axes respectivly.
first axes Xlabel : frequency Ylabel : Magnitude
senconde axes Xlabel : frequecny Ylabel : Phase
the command "Xlabel" and "Ylabel" are not working in the GUIde.

回答 (3 件)

Hengameh Noshahri
Hengameh Noshahri 2015 年 10 月 14 日
you can try following code in your user code:
plot(handles.axes,x,y);
xlabel(handles.axes,'xlabel')
ylabel(handles.axes,'ylabel')

Amardeep
Amardeep 2011 年 12 月 8 日
I place on static text boxes which I change the string handle of. Not massively elegant but it works.

Image Analyst
Image Analyst 2012 年 12 月 24 日
It's case sensitive. You need to use xlabel and ylabel, not Xlabel and Ylabel:
fontSize = 20; % Whatever you want.
% First for the first axes:
axes(handles.axes1);
xlabel('Frequency', 'FontSize', fontSize);
ylabel('Magnitude', 'FontSize', fontSize);
% Now for the second axes:
axes(handles.axes2);
xlabel('Frequency', 'FontSize', fontSize);
ylabel('Phase', 'FontSize', fontSize);

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by