Why Do Some Figure Properties Not Seem to be Applied Properly when Copy/Paste to/from Clipboard?
1 回表示 (過去 30 日間)
古いコメントを表示
I have two figures f1 and f2. f1 is created with bar() and f2 with histogram2(). For f1 I execute
set(f1,'Color','none')
set(f1,'InvertHardCopy','off')
print('-dmeta','-f1')
and I executed the same commands for f2.
When I go to PowerPoint and paste in f1 from the clipboard it comes in fine.
But when I paste in f2 from the clipboard, it comes into PowerPoint with a black background.
Is there some other figure property that might be different between f1 and f2 that could cause this difference in behavior?
0 件のコメント
採用された回答
Richard Quist
2021 年 11 月 23 日
My guess is that f2 is being copied to the clipboard as an embedded image which doesn't support transparency. By default the print command uses a heuristic to determine how to generate the content for vector formats like metafiles.
You can force the print command to produce "true vector" output by using the -vector option (R2021b or later). In earlier versions of MATLAB you can use the -painters option:
print(f1, '-dmeta', '-vector'); % 21b or later
print(f1, '-dmeta', '-painters'); % 21a or earlier
In R2020a or later you can use the copygraphics command instead of print, which has the added benefit of eliminating the extra whitespace that typically accompanies a plot:
copygraphics(f1, 'ContentType', 'vector')
その他の回答 (0 件)
参考
カテゴリ
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!