How to save a high resolution figure in MATLAB

When I save a shape from MATALB, I want the resulting image to get a very high resolution so that I can zoom in to see the details in the image. When I use β€œFile β†’ Save As” in the picture, the image does not have high resolution.

How to save a shape in a high resolution image in MATLAB?

+5
source share
1 answer

You can specify the desired resolution for saving the image either from the command line or from the File menu.

Command line: Using print , just enable the -r### option, where ### if the required permission. Usually 300 dots per inch (dpi) is high enough for my purposes, but if necessary, feel free to go higher. Obviously, the higher the dpi, the larger the image file size.

 print(gcf,'foo.png','-dpng','-r300'); *// 300 dpi 

View the MATLAB print documentation to see all print options that you can configure as follows.

File menu: Or, using "File β†’ Export installation ...", on the left side select "Rendering", then configure "Resolution (dpi)". The default value is "auto".

Like the command line, there are many printing options that you can configure in the File menu. Once you have worked hard and got everything you want, you can save the current export settings by default, so you do not need to do this every time you save a shape. This is done at the bottom of the same menu "Export Styles β†’ Save as style named:" β†’ select "default" and click "Save".

Here are some more good tips for keeping good shapes in MATLAB:

+6
source

Source: https://habr.com/ru/post/1232306/


All Articles