Figure in shrunk on screen when dimensions are set for publishing

3 次查看(过去 30 天)
I want to create a figure of 5 x 5 cm to insert as a panel on a larger figure for academic publishing. I would like to set the fontsize in matlab so that it is consistent across panels (ie. 8). I could for example export the figure with exportgraphics and rescale the figure in an image editor but then, the fontsize ends up being scaled also, which I do not want.
My problem is that if I set the figure dimension to 5x5, its appearance on the screen (4K resolution) becomes very small (spanning around 100 x 100 pixels on screen). I would like to be able to scale the figure displayed on the screen so that the 5 x 5 cm figure spans say 1000 x 1000 pixels (similar as in a pdf which you would open and zoom in).

回答(1 个)

Jaswanth
Jaswanth 2024-5-3
编辑:Jaswanth 2024-5-3
Hi Oliver,
To make a figure size appear larger on a 4K screen, you need to adjust the figure's DPI (dots per inch) setting. The DPI value controls how many pixels are used per inch of the figure, thus affecting its on-screen size. One possible solution is adding Resolution Name-Value Argument in your calls to the exportgraphics function. Default Resolution while using exportgraphics function is 150 which can be increased to desired value using Resolution Name-Value Argument.
Kindly refer to the code snippet below, where Resolution parameter has been utilized.
exportgraphics(gca, 'myFigure.png', 'Resolution', 300);
Please go through the following MathWorks documentations to learn more about Resolution Name-Value Arguments in exportgraphics function mentioned above: https://www.mathworks.com/help/matlab/ref/exportgraphics.html?s_tid=doc_ta#:~:text=Resolution%20%E2%80%94%20Resolution%20(DPI)
I hope the information provided above is helpful in accomplishing your task.
  5 个评论
Jaswanth
Jaswanth 2024-5-6
I regret if it sounded like a ChatGPT answer, but I would like to ascertain that my previous response was based on my own interpretation of the initial post and the subsequent comment. Could you please clarify what you mean by "zoom the figure"?
Specifically:
  1. Are you looking to enlarge the figure within the MATLAB environment for a clearer view on your screen, while keeping the dimensions intended for export unchanged?
  2. Are you looking for a way to ensure that zooming in on the figure within MATLAB figure window proportionally enlarges all elements, including text and graphics?
Olivier Roy
Olivier Roy 2024-5-6
I want 1. As an example, let's say that the figure has a 5 x 5 cm dimension and as axis labels with a font size of 8. On the 4k screen with the default DPI, is is thiny. Now, imagine that I export the figure as is and include it in a paper that ends up being in pdf format. When I open the PDF paper in a pdf viewer and zoom in (say, 200%), then the figure keeps the same proportions but of course, all its constituents are magnified (for example, the fontsize would not appear as being 8 points despite it being 8, due to zooming). What I want is to have the same representation of the image in Matlab as it would be in the zoomed in pdf paper.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Printing and Saving 的更多信息

标签

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by