Copy figure - bad quality

Hi all,
I have some problem with the quality of copied figure. If I plot something and then I chose edit-copy figure, no problems, I can paste them in word and the quality is good. BUT if I do some modifications on the figure, for example I add some text or shapes, then if I do copy figure, the quality of the pasted image in word is lower.. For example it's impossible to read well the axis label.. You have any idea of the solution for this problem?
Thank you

Respuestas (8)

Vinh Ho
Vinh Ho el 13 de Mayo de 2019
Editada: Vinh Ho el 13 de Mayo de 2019

3 votos

Go to copy options and choose "Metafile" for clipboard format. The resolution is pefect, alghouth it said "may loose information" but i did not have that problem yet.

5 comentarios

Muhammad Zayed
Muhammad Zayed el 26 de Ag. de 2020
The quality of the imported figure was greatly improved after I did that! Thanks much!
XIAOHUA HUA
XIAOHUA HUA el 20 de Abr. de 2022
Hum, really makes no sense to me.
3 options:
1, Metafile (may lose information)
2, Preserve information (metafile if possible)
3, Bitmap
To me, option 1 seems the worst choice in terms of picture quality but actually not at all.
Mario Rossi
Mario Rossi el 20 de Abr. de 2022
what's the point of commenting a 3 years old comment on a 10 years old thread?? moreover with a comment without any useful content.
Vincent Masabiar masabair
Vincent Masabiar masabair el 10 de Feb. de 2024
Thanks..........choosing "Metafile" for clipboard format worked for me!
Nick
Nick el 18 de Nov. de 2024
It does not seem this is an option on Mac. Are there any alternatives for Mac?

Iniciar sesión para comentar.

Malcolm Lidierth
Malcolm Lidierth el 22 de Mzo. de 2012

1 voto

1 comentario

Image Analyst
Image Analyst el 22 de Mzo. de 2012
Someone else just asked about saving and I referred him to the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_save_my_figure.2C_axes.2C_or_image.3F_I.27m_having_trouble_with_the_built_in_MATLAB_functions. (Make sure the final dot is included in the URL). The FAQ also which mentions export_fig(), which is the consistently the most downloaded File Exchange submission. I guess that's why questions on saving figures are the MOST commonly asked question - we get 1 to 3 a day or so.

Iniciar sesión para comentar.

Richard
Richard el 22 de Mzo. de 2012

0 votos

try saving the figure from matlab as a .jpg file by typing
ff =(C:\My Documents);
fnout = [ff, '\FigureName', num2str(1,'%.2d'), '.jpg'];
print('-djpeg','-r150',fnout);
This will then save the figure in my documents. Then in word go to inser--> picture.
If you want really high quality figures, you should save your figures as .eps files, but I dont think that word accepts these.
Mario Rossi
Mario Rossi el 22 de Mzo. de 2012

0 votos

Thank you for the answers.
@lestyn: I can manually export in jpg, but the situation is the same, even worse maybe..
@Malcom: yes, I've already tried export_fig, but nothing changes.
The key point is that I don't understand why the copied figure changes between the situation "figure without any change", and the "figure after that I add some shapes"... It should be the same!
Malcolm Lidierth
Malcolm Lidierth el 22 de Mzo. de 2012

0 votos

This will not improve the image like export_fig but it does reproduce what's on screen -so if if you do not see grotty graphics on screen this may help.
It calls
this=MUtil.getFigureHWLWContainer(fh);
which is defined in Project Waterloo http://sourceforge.net/projects/waterloo/, and returns a reference to the MATLAB heavyweight/lightweight container but you could get that in other ways e.g. with Yair Altman's findjobj.
Dependent jars are part of the standard MATLAB distribution and are on the static javaclasspath.
MATLAB seem to build graphics in an offscreen buffer then paste a bitmap into the Java AWT Canvas. Here, that is replaced with an Apache Batik SVGCanvas. The MALAB graphics will be embedded as a bitmap in the file.
function SaveAsSVG(fh, str)
% SaveAsSVG saves a MATLAB figure to an SVG file
% Example:
% SaveAsSVG(figurehandle, filename)
% where filename is the fully qualified name of the file to write.
%----------------------------------------------------------------------
% Part of Project Waterloo and the sigTOOL Project at King's College
% London.
% Author: Malcolm Lidierth 03/11
% Copyright © The Author & King's College London 2011-
% Email: sigtool (at) kcl.ac.uk
% ---------------------------------------------------------------------
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.io.Writer;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.batik.dom.GenericDOMImplementation;
import org.apache.batik.svggen.SVGGeneratorContext;
import org.apache.batik.svggen.SVGGraphics2D;
import org.apache.batik.svggen.SVGGraphics2DIOException;
import org.w3c.dom.DOMImplementation;
this=MUtil.getFigureHWLWContainer(fh);
if nargin<2 || isempty(str)
str='untitled.svg';
end
[folder filename ext]=fileparts(str);
if isempty(ext);ext='.svg';end
if isempty(folder);folder=pwd();end
str=[fullfile(folder, filename), ext];
thisFile = File(str);
OutputStream = [];
try
OutputStream =FileOutputStream(thisFile);
catch ex
end
domImpl = GenericDOMImplementation.getDOMImplementation();
svgNS = 'http://www.w3.org/2000/svg';
document = domImpl.createDocument(svgNS, 'svg', []);
svgGenerator = SVGGraphics2D(document);
svgGenerator.scale(1,1);
this.paint(svgGenerator);
try
out = OutputStreamWriter(OutputStream, 'UTF-8');
catch ex
end
try
svgGenerator.stream(out, true);
catch ex
end
end
Mario Rossi
Mario Rossi el 26 de Mzo. de 2012

0 votos

if I have to use this long method, so it's much faster to copy and paste in paint or some kind of image editing program... Thank you anyway!
John Petersen
John Petersen el 27 de Jul. de 2012

0 votos

Save it as a .emf or .png file. These retain image quality for graphs and plots with lines.
Albert Yam
Albert Yam el 27 de Jul. de 2012

0 votos

This might just be copy/paste but, try
print -s -dmeta

Categorías

Más información sobre Environment and Settings en Centro de ayuda y File Exchange.

Preguntada:

el 22 de Mzo. de 2012

Editada:

el 18 de Nov. de 2024

Community Treasure Hunt

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

Start Hunting!

Translated by