Using get and set command to add a title, xlabel, and ylabel?

조회 수: 99 (최근 30일)
Tyler Bodnarik
Tyler Bodnarik 2020년 9월 29일
댓글: Tyler Bodnarik 2020년 9월 29일
Is there a way to add a title and x and y axes labels to a figure by using only the get and set commands? Also, I need to change the fontsize and make them bold. It should all be done by using get and set exclusively.
Thanks in advance!

채택된 답변

Joseph Cheng
Joseph Cheng 2020년 9월 29일
You can take a look by first extracting out the current axis or assign it to a variable:
hax = gca;
then you can see all the parameters you can change. by looking through the output you can see that you can change ylabel though its also an "object" so you'll need to look inside
for an example of your ylabel and bold
Additionally in newer matlabs you don't need to use set anymore but treat it as an structure and change for example fontsize by
h.YLabel.FontSize = 9

추가 답변 (0개)


Help CenterFile Exchange에서 Labels and Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by