How do you specify a figure window to copy onto a word file?

1 vue (au cours des 30 derniers jours)
Julian Bello
Julian Bello le 26 Juin 2018
In my code, I generate a figure of a graph through the usage of a GUI. Then, I want to save the figure as both a .fig file and as an image in a word file. The figure correctly saves as just a graph for the fig file, but when placed in the word document, the figure appears as the entire GUI screen instead of just the graph. How do I specify so that only the graph appears instead of the whole GUI screen?
Parts of the code:
Fig2 = figure;
copyobj(handles.current_graph, Fig2); %handles.current_graph is the axes graphic object of the graph
hgsave(Fig2, 'myFigure.fig');
%(lines of code to create the word document)
Fig2
% Capture current figure/model into clipboard:
print -dmeta
% Find end of document and make it the insertion point:
end_of_doc = get(ActXWord.activedocument.content,'end');
set(ActXWord.application.selection,'Start',end_of_doc);
set(ActXWord.application.selection,'End',end_of_doc);
% Paste the contents of the Clipboard:
invoke(ActXWord.Selection,'Paste');
ActXWord.Selection.TypeParagraph; %enter

Réponses (0)

Catégories

En savoir plus sur Printing and Saving dans Help Center et File Exchange

Produits


Version

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by