How do i make the title, axes labels, and legends larger in existing figures?

조회 수: 3 (최근 30일)
Griffin Williams
Griffin Williams 2019년 1월 28일
답변: madhan ravi 2019년 1월 28일
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?

답변 (2개)

Kevin Phung
Kevin Phung 2019년 1월 28일
편집: Kevin Phung 2019년 1월 28일
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!

madhan ravi
madhan ravi 2019년 1월 28일
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;

카테고리

Help CenterFile Exchange에서 Title에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by