Code covered by the BSD License  

Highlights from
Scalable Vector Graphics (SVG) Export of Figures

image thumbnail

Scalable Vector Graphics (SVG) Export of Figures


Juerg Schwizer (view profile)


10 Apr 2005 (Updated )

Converts 3D and 2D MATLAB plots to the scalable vector format (SVG).

Editor's Notes:

This file was a File Exchange Pick of the Week

svgGaussianBlur(s, source, deviation, result)
function svgGaussianBlur(s, source, deviation, result)
% Adds a feGaussianBlur SVG filter
% PRELIMINARY IMPLEMENTATION (Parameters may change)
% svgGaussianBlur(s, source, deviation, result)
% Parameters:
%   s : Array of plot object handles
%   source : Any previous defined filter result string, 'SourceGraphic',
%            or 'SourceAlpha'.
%   deviation : Blur strength
%   result : String that identifies the filter result for following filter
%            stages.   
for i = 1:length(s)
    userdata = get(s(i),'UserData');
    if isfield(userdata, 'svg') && isfield(userdata.svg, 'Filter')
        next = length(userdata.svg.Filter) + 1;
        next = 1;
    userdata.svg.Filter(next).Subfilter.Type = 'feGaussianBlur';
    userdata.svg.Filter(next).Subfilter.Deviation = deviation;
    userdata.svg.Filter(next).Subfilter.Source = source;
    userdata.svg.Filter(next).Subfilter.Result = result;
    set(s(i),'UserData', userdata);

Contact us