How do I change the font size of city names on a map that has already been created?
3 次查看(过去 30 天)
显示 更早的评论
I would like to enlarge the font of the city names displayed on a map that has already been created.
采纳的回答
MathWorks Support Team
2009-6-27
Text objects on a map are the same as any other text object. You can change the fontsize of the text object once you have the object handle using the SET function.
The following method extracts all text objects in the current figure that have a non-empty string, and changes their fontsize:
figure; axesm miller
framem('FEdgeColor','red')
textm(60,90,'hello')
textm(50,90,'hello')
textm(40,90,'hello')
textm(30,90,'hello')
h = findall(gca, 'type', 'text');
h_string = get(h, 'string');
index = find(~strcmp(h_string, ''))
h_new = h(index);
set(h_new, 'fontsize', 17)
Note: this may also change the fontsize of axis labels if they already contain strings. The XLABEL, YLABEL, and ZLABEL are text objects which are children of the axes.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Labels and Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!