Trim whitespace from SVG file

버전 1.0.0 (2.04 KB) 작성자: Ivar Eskerud Smith
Trim the whitespace from a SVG file by setting the viewBox equal to the bounding box.
다운로드 수: 82
업데이트 날짜: 2018/10/19

라이선스 보기

Trim the whitespace from a SVG file by setting the viewBox equal to the bounding box.
Requires ImageMagick installed to obtain the bounding box.

Example:
x = 0:pi/100:2*pi;
figure;subplot(2,1,1);plot(x,sin(x));ylabel('Sine');
subplot(2,1,2);plot(x,cos(x));ylabel('Cosine');
saveas(gcf,'test.svg'); %For instance insert this file into Word, and there is whitespace around the plot.
trimSVGFile('test.svg');
%Now insert this file into Word, and there is no whitespace.

인용 양식

Ivar Eskerud Smith (2024). Trim whitespace from SVG file (https://www.mathworks.com/matlabcentral/fileexchange/69152-trim-whitespace-from-svg-file), MATLAB Central File Exchange. 검색됨 .

Inspired by: https://se.mathworks.com/matlabcentral/fileexchange/49617-svg_fix_viewbox-in_name-varargin

MATLAB 릴리스 호환 정보
개발 환경: R2015a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0