create figure with resolution and loglog plot
조회 수: 2 (최근 30일)
이전 댓글 표시
hello,
I tried to set a window with a specific resolution of 4 graphs (with subplot) and one of them from loglog.
When I tried to set the window with setting the resolution the graphs become smaller and rise on top of each other
I used the command:
name_of_figure=figure('rend','painters','pos',[15 30 1500 900]);
And then saving the file using the command
saveas(name_of_figure,'name_of_figure');
saveas(name_of_figure,'name_of_figure.emf');
I will be happy to receive command tu create figure with loglog plot and with define resolution.
댓글 수: 0
답변 (1개)
Akshat
2024년 12월 26일
In order to make the plots with respect to pixels of the screen, which is my understanding of the issue here, you can set the "Units" property of the figure to "Pixels".
This will make the figure consistent and fit a particular size specified by you.
You just need to change the initialisation of the 'figure' object, something like this:
% Create the figure with correct resolution
name_of_figure = figure('Units', 'pixels', ...
'Position', [100 100 1500 900], ...
'PaperPositionMode', 'auto', ...
'Renderer', 'painters');
While saving, you can add the DPI (Dots Per Inch) of the image that you want to save by this following edit:
print(fig, 'name_of_figure', '-dmeta', '-r300'); % EMF format with 300 DPI
saveas(fig, 'name_of_figure.png'); % PNG format
Hope this resolves the issue you are facing.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Printing and Saving에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!