I want to create printouts with exact sizes (1=1")
11 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I somewhat frequently use Matlab to create images of things I want to build (as in build a physical object). In some situations, it would be useful to create a figure that's the exact size of the object I want to build. I can create, for example, a box that's 1x1 in the dimensions of my figure, but by the time I go through saving and then printing with all the attendant options, the "size" gets changed multiple times.
I'm about to write a function that creates a figure of a specified size and then exports that figure to a file and then print that file and then measure 1 unit with a ruler and then keep adjusting the parameters until I get it approximately right, but if there's a cleaner way to do it I'd like to hear it.
0 comentarios
Respuesta aceptada
Chunru
el 22 de Abr. de 2022
Editada: Chunru
el 22 de Abr. de 2022
g = figure;
g.Units = 'inches';
g.Position = [1 2 3 3]; % 3 by 3 inches
plot(rand(10,1));
saveas('test.pdf');
% You can measure the figure size in pdf to be the one you specified (outer
% box including the axis labels)
% If you want to set the axes size
%{
a = gca;
a.Units = "inches";
g.Position = [1 2 3 3]; % adjust these values
%}
6 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Graphics Object Properties en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!