Improving resolution of the plots in Matlab

12 views (last 30 days)
Go Sugar
Go Sugar on 16 Oct 2022
Edited: Go Sugar on 22 Oct 2022
Hello :)
I have several matlab plots. When I try to save them in jpg or emf formats, I get poor resolution. I want to obtain a similar resolution like when I save it from matlab.fig file to jpg or emf (with a full screen). Since I have many figures, that is wasting time. Below is the simplest command for a few figures. Is there a way to improve the resolution with saveas command? And do I have to copy and paste each figure to transfer it into word document? I have searched the forum and could not find any suggestions with saveas command for improving the resolution.
Thank you so much. =)
for b=1:4
saveas(figure(b),['FIG' num2str(b'),'.jpg']);
saveas(figure(b),['FIG' num2str(b'),'.emf']);
saveas(figure(b),['FIG' num2str(b'),'.fig']);
end
  10 Comments
Go Sugar
Go Sugar on 22 Oct 2022
Edited: Go Sugar on 22 Oct 2022
Thank you so much for all the help, you are so nice. =) Now I will be able to fix the messy look of the numbers. =) It will work fine for me. I cannot even put a vote to your comment but it solved the messy look of the numbers. =) In this way, everything looks more organized. Have a great day!

Sign in to comment.

Answers (1)

Harsha
Harsha on 19 Oct 2022
The “saveas” function uses a resolution of 150 DPI and uses “PaperPosition” and “PaperPositionMode” properties of the figure to determine the size of the image. There is no way to change the resolution of the output using the “saveas” command.
To control the size or resolution when you save a figure, use “print” function instead.
Refer to the following documentation for using the “print” function: -
From MATLAB R2020a you can use the “exportgraphics” function to save any axes, figure, chart that can be child of a figure, tiled chart layout, or container such as panel with specific size, resolution, or background color.
Refer to the following documentation on using “exportgraphics” function: -
use exportgraphics to save only the right one and check if you are getting a better ouput.
  1 Comment
Go Sugar
Go Sugar on 22 Oct 2022
Thank you so much for the information. I will check the links provided, be sure that I am not missing anything and see if I get a better output. I will also try representing the data in another way, I have so many bars. I will let you know if I can solve it thank you for your time. =)

Sign in to comment.

Categories

Find more on Printing and Saving in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!