Changing the points to pixels rendering ratio

조회 수: 5 (최근 30일)
Alexander Hensley
Alexander Hensley 2019년 11월 3일
답변: Subhadeep Koley 2019년 11월 5일
I am creating figures for a journal paper via MATLAB, and I copy these figures into Adobe Illustrator to do final tweaks. The real size of the figures for the journal are no more than 240 points by 240 points (1 pt being 1/72 of an inch). It's helpful to work in real units the whole time, so I set all my MATLAB figures to use units "points". However, this makes creating figures difficult as a plot of 120x120pts in size for example is incredibly small when rendered to the screen. I have included an example picture. Is there a way to change the scale of MATLAB's plot renderer so that say, 120pts corresponds to several hundred pixels? I would like to specify the length to pixel ratio.
  댓글 수: 3
Image Analyst
Image Analyst 2019년 11월 3일
And why can't you resize it by just grabbing the corner or edge of the figure and dragging it bigger?
Alexander Hensley
Alexander Hensley 2019년 11월 3일
Fair question, while dragging does make the figure appear bigger, it does not scale everything uniformly. Minutia like relative marker size, line thickness, and data point spacing are all important to creating a clean, cohesive figure, but rescaling the figure by dragging disrupts all these properties. I have posted a picture as an example.
example2.png

댓글을 달려면 로그인하십시오.

답변 (1개)

Subhadeep Koley
Subhadeep Koley 2019년 11월 5일
You can first tweak your figure in the default large rendering then only use the below code to resize and save your plot to any desired size, resolution, and format.
figure('Color','w'); surf(peaks);
% Set your preferred dimension
set(gcf, 'Units', 'points', 'Position', [0, 0, 240, 240]);
% Print in raster PNG format
print('test','-dpng','-r0'); % change the 3rd argument to change resolution '-r0' is the screen R % resolution
% Print in true vector EPS format
print('test','-depsc','-painters');
On the more, the function export_fig() can be very helpful to you for exporting your plot to any desired size, resolution, and format after tweaking.
Hope this helps!

카테고리

Help CenterFile Exchange에서 Grid Lines, Tick Values, and Labels에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by