Plots saved as JPEG look awful. How to improve?

조회 수: 26 (최근 30일)
Kristine
Kristine 2025년 3월 11일
답변: James Tursa 2025년 3월 11일

Hey y’all

I’ve been saving graphs as JPEGs to be able to upload them to a PowerPoint, but the quality looks really bad.

I run my script via editor, then save my figures from the window that pops up with my individual graphs.

Are there settings somewhere to improve the quality or size of the saved figure?

Thanks!

답변 (4개)

Mike Croucher
Mike Croucher 2025년 3월 11일
편집: Mike Croucher 2025년 3월 11일
JPEG is a lossy file format which means that it can have a degradation in quality from the original.
If Powerpoint is to be the final destination of your images then I suggest that you save as a .png file format which is lossless. As such, they will look much better in PowerPoint.
From the figure window click on File->Save As and in the Save As Type drop down box choose 'Portable Network Graphics (*.png)

Image Analyst
Image Analyst 2025년 3월 11일
If you're saving an image, use imwrite and save as a PNG format file. If you are saving an image and want the title, axes, and any graphics in the overlay, or if you're saving a plot. Maximize your figure window first and then save it, since exportgraphics will save a screenshot.
hFig = figure('Name', 'My Plot');
plot(1:10);
hFig.WindowState = 'maximized'
exportgraphics(hFig, 'Screenshot.png');

DGM
DGM 2025년 3월 11일
이동: Walter Roberson 2025년 3월 11일
Don't save flat-colored synthetic graphics with hard edges as JPG, especially not if you can't control the quality and downsampling (which you can't in MATLAB). The result is an irreversibly-damaged image that's typically significantly larger than common lossless PNG. Unless you know what the consequences of using a 4:2:0 75% JPG are, simply don't use it.
For demonstration purposes:

James Tursa
James Tursa 2025년 3월 11일
You might also explore export_fig from Yair Altman, found here:

카테고리

Help CenterFile Exchange에서 Printing and Saving에 대해 자세히 알아보기

제품


릴리스

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by