Figure in shrunk on screen when dimensions are set for publishing

14 visualizaciones (últimos 30 días)
Olivier Roy
Olivier Roy el 25 de Mzo. de 2024
Comentada: Olivier Roy el 6 de Mayo de 2024
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).

Respuestas (1)

Jaswanth
Jaswanth el 3 de Mayo de 2024
Editada: Jaswanth el 3 de Mayo de 2024
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 comentarios
Jaswanth
Jaswanth el 6 de Mayo de 2024
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 el 6 de Mayo de 2024
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.

Iniciar sesión para comentar.

Categorías

Más información sobre Printing and Saving en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by