matlab: what is the command-line equivalent of 'copy figure'?

Viewed 154

If I use print -clipboard -dmeta I get a different result (non-vectorized when pasting into Illustrator) than when I literally click 'copy figure' in the figure window.

  1. Does anyone know what happens when you click 'copy figure' in the figure menu ('under the hood'?)
  2. Is there a matlab function that would mimic this function more precisely than
    print -clipboard -dmeta?

ver output:

MATLAB Version: 9.9.0.1524771 (R2020b) Update 2
2 Answers

It seems, something is not correct, because the command print -clipboard -dmeta copy the figure as vector data

Anyway you can alternatively save as the current figure with Enhanced metafile extension: saveas(gcf, 'Fig1.emf'), then load the vector-based file into any software.

Both

print -clipboard -dmeta

and

hgexport(gcf, '-clipboard')

will export the current figure as a Windows metafile if:

  1. You’re on a Windows platform.
  2. The figure uses the Painters renderer.

When using the OpenGL renderer, exports are always as a bitmap.

To switch a figure to use the Painters renderer, use

set(gcf,'renderer','painters');
Related