How do you specify a figure window to copy onto a word file?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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
0 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Printing and Saving en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!