How to modify figures programmatically?
조회 수: 3 (최근 30일)
이전 댓글 표시
I am trying to write a code which
- Full screen the figure.
- Plots the graph.
- Change font size to 24.
- Change line width to 2.
- Turns grid on, and labels x, and y-axes.
- Put a legend with font size 24.
- Saves the file as eps, png, and fig with 600 dpi resolution.
figureFullScreen
loglog(x1, y1, x2, y2)
set(gca,'fontsize', 24)
set(findall(gca, 'Type', 'Line'),'LineWidth',2);
grid on, xlabel('\Delta x'), ylabel('Maximum Error')
legend({'Maximum Error in Conventional Scheme','Maximum Error in Proposed Scheme'}, 'FontSize', 28)
print(gcf, 'OneD_E1_a1_Convergence_Study_Max_Error','-depsc','-r600');
print(gcf, 'OneD_E1_a1_Convergence_Study_Max_Error','-dpng','-r600');
savefig('OneD_E1_a1_Convergence_Study_Max_Error.fig'),
For details of "figureFullScreen", please visit: https://www.mathworks.com/matlabcentral/fileexchange/31793-minimize-maximize-figure-window
Now I want to achieve
- Save .fig file in 600 dpi.
- expand axis to fill figure.
I need help with these 2 task.
Thank you.
댓글 수: 2
dpb
2018년 8월 29일
See the 'Position' and 'OuterPosition' properties and 'Units'
I'm not sure you can enforce a specific dpi into the .fig file.
Walter Roberson
2018년 8월 29일
.fig files cannot be saved as a particular resolution. .fig files are copies of the graphics objects such as the line and legend objects as data structures. .fig files are not rendering of graphics, they are the data structures that you can reload to recreate the graphics objects.
답변 (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!