How do i make the title, axes labels, and legends larger in existing figures?
3 views (last 30 days)
Show older comments
I need to make the title, axes labels, and the legend all at least twice the size of the typical size in my Matlab figures. These figures already exist and it would be a lot easier if I could just change the already existing titles, labels, and legends in the figure. Is there any way of doing this?
0 Comments
Answers (2)
Kevin Phung
on 28 Jan 2019
Edited: Kevin Phung
on 28 Jan 2019
each one of those graphic objects (title,axes,legend) has their own properties you can edit.
for example, if you havent assigned them a handle running:
my_axes = gca; %gets your current axes and assigns it to a handle 'my_axes'
would return something like:
XLim: [-4 4]
YLim: [-0.0500 0.4000]
XScale: 'linear'
YScale: 'linear'
GridLineStyle: '-'
Position: [0.1418 0.1702 0.7632 0.7547]% [x,y, width,height] relative to the fig
Units: 'normalized'
Show all properties
I can access / change these properties by one of the following:
get(my_axes,'Units') % would return me 'normalized'
set(my_axes,'Units','pixels') %changes units
my_axes.Units = 'normalized' %change back the units
To find graphic objects within your figure,
you can do:
get(gcf,'Children') %gcf = gets current figure, will return all children
another method is to just click on your graphics object and run:
obj = gco; %this will quickly return the object you just clicked
%and assign it the handle 'obj'
let me know if this helps!
0 Comments
madhan ravi
on 28 Jan 2019
Yes just create a handle and manipulate to your wish:
l=legend(...)
l.FontSize=2*9; % twice than default size
x=xlabel(...)
x.FontSize=11*2;
0 Comments
See Also
Categories
Find more on Title 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!