Copy figure to clipboard
9 次查看(过去 30 天)
显示 更早的评论
I have a pushbutton on a gui that calls a seperate function. In this function I create a figure and perform four suplots.
The figure is create via:
hFig = figure('Name','Histograms from gtc Files', 'Resize','on', 'Position',[400 100 1000 800],'numbertitle','off','visible','on');
movegui(hFig,'center')
After the subplot are plotteds, I want to autosave the whole figure and copy to clipboard. (hardcoded within my function.)
The autosave works after reading how to do it:
hgexport(hFig, savepath, hgexport('factorystyle'), 'Format', 'jpeg');
But I cannot get the copy to clipboard to work. I have tried both
%Copy to clipboard
print -dmeta -noui
and this approach
hCopyFigure = findobj(hFig,'Label','Copy &Figure'); %# Handle for the "Copy
%# Figure" menu item
get(hCopyFigure,'Callback')
editmenufcn(gcbf,'EditCopyFigure')
I can't find anywhere that shows a clear way to do it. Thanks Jason
0 个评论
采纳的回答
Sean de Wolski
2014-12-11
编辑:Sean de Wolski
2014-12-11
>> print -clipboard -dbitmap
Or
>> print -clipboard -dmeta
0 个评论
更多回答(1 个)
Image Analyst
2014-12-11
MATLAB's clipboard() function can't handle it, but leave it to Yair to find a way:
Also see Jiro Doke's File Exchange: http://www.mathworks.com/matlabcentral/fileexchange/28708-imclipboard/content/imclipboard.m
3 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!