Apply "Figure Copy Template" within m file code

조회 수: 10 (최근 30일)
George Gray
George Gray 2020년 6월 14일
댓글: Voss 2023년 10월 1일
When I copy a figure to paste into a powerpoint file, I usually go to Edit/Copy Options/Figure Copy Template and then click "presentations" and "apply". This makes the figure labels bolded and larger so they show up better in a ppt file, especially when you shrink it down. How do I do that "automatically" from within the m-file? It would seem like there would be a simple function call that I could put into my m-file after I create the figure. I'd put that call in for the figures that I'm most likely to copy over, saving me a bunch of time. But I haven't been able to find anything. Thanks in advance.
  댓글 수: 3
George Gray
George Gray 2023년 10월 1일
I had not; thanks for answering!
Voss
Voss 2023년 10월 1일
@George Gray: If my answer solves the problem, please consider Accepting it. Thanks!
Also thanks to @Sebastian for commenting or I wouldn't have seen this three-year-old question!

댓글을 달려면 로그인하십시오.

답변 (1개)

Voss
Voss 2023년 9월 27일
편집: Voss 2023년 9월 27일
Here's some code that programmatically applies the default Presentation settings (Change font size to 140% of original, Bold, Set lines' width to 2 points).
% some figure:
f = figure();
plot(1:10)
xlabel('x')
ylabel('y')
title('title')
% settings:
font_size_factor = 1.4;
font_weight = 'bold';
line_width = 2;
% apply the settings:
% 1) increase FontSize by font_size_factor:
obj = findall(f,'-property','FontSize');
fs = get(obj,'FontSize');
fs = num2cell(font_size_factor*vertcat(fs{:}));
set(obj,{'FontSize'},fs);
% 2) set FontWeight to font_weight:
obj = findall(f,'-property','FontWeight');
set(obj,'FontWeight',font_weight);
% 3) set lines' LineWidth to line_width:
obj = findall(f,'Type','line');
set(obj,'LineWidth',line_width);

카테고리

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

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by