Comment améliorer la résolution des figures générée par la fonction "montage" ?

13 次查看(过去 30 天)
Bonjour,
La fonction "montage" offre des fonctionnalité très pratique, mais en standart elle produit des images de très mauvaises qualité (cf image ci-dessou). L'aide de montage n'est pas claire à ce sujet, du moins je n'ai pas trouvé. Je joint le code pour reproduire la figure ci-dessous à partir d'images de bonne résolution (attachée pour pouvoir reproduire le pb).
comment améliorer cette résolution ?
Merci
Timothée
dirOutput = dir("*V3.png");
fileNames = string({dirOutput.name});
montage(fileNames,"Size",[2 2]);
figurename = ['Montage_lolly'];
set(gcf, 'PaperUnits', 'centimeters');
x_width=18 ;y_width=12;
set(gcf, 'PaperPosition', [0.25 0.25 x_width y_width]);
print(figurename,'-dpng')
  1 个评论
Mathieu NOE
Mathieu NOE 2024-1-25
bonjour
je ne crois pas qu'il s'agisse d'un défaut de la fonction montage
je pencherais plutôt pour le fait que l'image resultate a été enregistrée ( print(figurename,'-dpng')) avec un paramétrage non optimal
suggestion :
  • augmenter la taille de la figure / resize
  • augmenter la résolution
cf la doc de print :
resize Option to expand figure to fill page
'-fillpage' | '-bestfit'
Option to expand figure to fill page, specified as one of these values:
  • '-fillpage' — Maximize the size of the figure to fill the page. Leave a .25 inch margin on all sides of the page. The tick marks, layout, and aspect ratio of the figure might change.
  • '-bestfit' — Maximize the size of the figure to fill the page, but preserve the aspect ratio of the figure. The figure might not fill the entire page. This option leaves a minimum page margin of .25 inches.
Both options are valid only when printing a figure to a printer or saving to a page format such as PDF and PS. They are not valid for Simulink block diagrams.
resolution Resolution
character vector | string
Resolution, specified as a character vector or a string containing -r and an integer value indicating the resolution in dots per inch. For example, '-r300' sets the output resolution to 300 dots per inch. To specify screen resolution, use '-r0'.
In general, using a higher resolution value yields higher-quality output, but at the cost of higher memory use and larger output files. The higher the resolution setting, the longer it takes to render your figure.
Specifying the resolution is useful when creating an image or when using the OpenGL renderer with a vector graphics file format (since OpenGL produces an image even with vector formats). Specifying the resolution has no effect when using the Painters renderer with a vector graphics file format, since Painters produces a true vector graphics file that contains the commands that redraw the figure.

请先登录,再进行评论。

回答(0 个)

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!