what is the meaning of set(gca,'Fontsize',16)

52 views (last 30 days)
B Kha
B Kha on 1 Feb 2022
Edited: Arif Hoq on 1 Feb 2022
what is the meaning of set(gca,'Fontsize',16)

Answers (2)

Star Strider
Star Strider on 1 Feb 2022
The gca function returns the handle to the current axes object. The set call sets the 'FontSize' of the associated text objects to 16 points.

Arif Hoq
Arif Hoq on 1 Feb 2022
try to plot:
a = linspace(0,10,150);
b = 2*cos(a);
plot(a,b,'Color','r')
  2 Comments
Arif Hoq
Arif Hoq on 1 Feb 2022
Edited: Arif Hoq on 1 Feb 2022
now apply 'gca' in the plot. 'gca' sets the current axes for the current figure which is created before.
a = linspace(0,10,150);
b = 2*cos(a);
plot(a,b,'Color','r')
ax=gca;
ax.YLim = [-4 4]; % in previous figure it was [-2 2]
Arif Hoq
Arif Hoq on 1 Feb 2022
Edited: Arif Hoq on 1 Feb 2022
'set' sets the property of any object. 'Fontsize' sets the text font to 16.
a = linspace(0,10,150);
b = 2*cos(a);
plot(a,b,'Color','r')
ax=gca;
ax.YLim = [-4 4];
set(gca,'Fontsize',16)

Sign in to comment.

Categories

Find more on Entering Commands in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!