Bump --> How to change tick label fonts in Matlab figure

94 views (last 30 days)
I am plotting a bode diagram of transfer functions. I want the "tick label" fonts of both the magnitude plot and phase plot to be of size 20 and to be black color. For some reason the tick label font size of the magnitude plot is always small. And the tick label font color is grey. It would be great help if someone could point me towards a way of doing it.
The code is as follows:
s = tf('s');
tf1 = s/(s+1); tf2 = (s+2)/(s^2+2*s+3);
figure; hold on;
object_handles2 = findall(gcf);
c1d = findobj(object_handles2,'Type','text');
c2d = findobj(object_handles2,'Type','line');
set(c1d,'FontSize',20,'FontWeight','bold','color',[0 0 0])
set(gcf,'Position',[100 0 700 700])
hold off;

Accepted Answer

Shoaibur Rahman
Shoaibur Rahman on 25 Feb 2015
Here is an example on how you could use set function to accomplish your job. Delete any pairs of input arguments if not required.
Shoaibur Rahman
Shoaibur Rahman on 26 Feb 2015
Instead of bode , use bodeplot function, and then set properties using getoptions and setoptions functions.
h = bodeplot(tf1,'b',tf2,'r');
p = getoptions(h);
p.Ticklabel.FontSize = 20;
p.Ticklabel.Color = 'k';

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by