Rank: 322372 based on 0 downloads (last 30 days) and 0 file submitted
photo

Philippe

E-mail
Company/University
RWTH Aachen

Personal Profile:

 

Watch this Author's files

 

Comments and Ratings by Philippe
Updated File Comments Rating
16 Jul 2012 Scalable Vector Graphics (SVG) Export of Figures Converts 3D and 2D MATLAB plots to the scalable vector format (SVG). Author: Juerg Schwizer

I had a problem with exporting a figure:

Subscript indices must either be real positive integers or logicals.

Error in plot2svg>axchild2svg (line 1570)
patch2svg(fid, group, axpos, x(faces_nonan), y(faces_nonan),
facecolorname, linestyle, linewidth, edgecolorname, face_opacity,
edge_opacity, closed)

After investigation, the error is caused by patches with NaN faces. Removing NaN elements from the faces array fixed the problem. Here is the modification around line 1566:

faces_nonan = faces(p,:);
faces_nonan = faces_nonan(isfinite(faces_nonan));

if flat_shading
patch2svg(fid, group, axpos, x(faces_nonan), y(faces_nonan), facecolorname, linestyle, linewidth, edgecolorname, face_opacity, edge_opacity, closed)
else
gouraud_patch2svg(fid, group, axpos, x(faces_nonan), y(faces_nonan), cdata, linestyle, linewidth, edgecolorname, face_opacity, edge_opacity, id)
end

Thank you for this great library!

Contact us