Rank: 172 based on 511 downloads (last 30 days) and 2 files submitted
photo

Juerg Schwizer

E-mail

Personal Profile:

Visit my blog http://www.zhinst.com/blogs/schwizer/ to get more information on the usage of plot2svg. There you find some tutorials how you can create stylish plots or get your figures ready for scientific publications.


 

Watch this Author's files

 

Files Posted by Juerg Schwizer View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
17 Sep 2012 Screenshot Scalable Vector Graphics (SVG) Export of Figures Converts 3D and 2D MATLAB plots to the scalable vector format (SVG). Author: Juerg Schwizer specialized, plotting, svg, converter, plot2svg, figure 499 137
  • 4.62857
4.6 | 117 ratings
25 Apr 2005 plot2mif Vector graphics export of 2D MATLAB plots to Framemaker MIF-files. Author: Juerg Schwizer graphics import, graphics export, framemaker, mif, converter, vector 12 4
  • 4.5
4.5 | 3 ratings
Comments and Ratings by Juerg Schwizer View all
Updated File Comments Rating
30 Nov 2014 Scalable Vector Graphics (SVG) Export of Figures Converts 3D and 2D MATLAB plots to the scalable vector format (SVG). Author: Juerg Schwizer

To all Matlab R2014b users:

As the graphic engine of Matlab R2014b contains major changes some functionality is no more compatible. The svg format is finally supported natively. Unfortunately, the resulting files are sometimes very big. The latest version of plot2svg can be found on git

https://github.com/jschwizer99/plot2svg

The current version available contains first changes needed for Matlab R2014b support. Please also report bugs there.

06 Sep 2010 Scalable Vector Graphics (SVG) Export of Figures Converts 3D and 2D MATLAB plots to the scalable vector format (SVG). Author: Juerg Schwizer

Dear Catarina,

Many thanks for your feedback. Unfortunately, plot2svg has at the moment no support for depth sorting of graphics objects. Only depth sorting of surfaces is supported. To support an universal dept-sorting I have to design a z-buffer algorithm from scratch or use a c++/java library. Or I would need access to the Matlab internals. At the moment, my plot2svg has to generate the svg elements just from the user data. Also the svg element saving has to be changed as I need some further buffering and sorting before writing the svg file. Thus, it would be a major change.
For your application, you have to split the line into two parts and sort the elements according their z-position in the view space. There are some code fragments in the plot2svg code that do the same thing for surfaces.
I'm sorry that I can give you no better advice at the moment. Let's hope that the Matlab graphics engine itself gets some upgrading with improved support of all the new technologies like svg, filters, animation, ...
Juerg

06 Mar 2010 Scalable Vector Graphics (SVG) Export of Figures Converts 3D and 2D MATLAB plots to the scalable vector format (SVG). Author: Juerg Schwizer

% Example how to adjust your figure properties for
% publication needs (answer to Aslak Grinsted's question)
s = figure;
% Select the default font and font size
% Note: Matlab does internally round the font size
% to decimal pt values
set(s, 'DefaultTextFontSize', 10); % [pt]
set(s, 'DefaultAxesFontSize', 10); % [pt]
set(s, 'DefaultAxesFontName', 'Times New Roman');
set(s, 'DefaultTextFontName', 'Times New Roman');
% Select the preferred unit like inches, centimeters,
% or pixels
set(s, 'Units', 'centimeters');
pos = get(s, 'Position');
pos(3) = 8; % Select the width of the figure in [cm]
pos(4) = 6; % Select the height of the figure in [cm]
set(s, 'Position', pos);
set(s, 'PaperType', 'a4letter');
% From SVG 1.1. Specification:
% "1pt" equals "1.25px"
% "1pc" equals "15px"
% "1mm" would be "3.543307px"
% "1cm" equals "35.43307px"
% "1in" equals "90px"

28 Feb 2010 Scalable Vector Graphics (SVG) Export of Figures Converts 3D and 2D MATLAB plots to the scalable vector format (SVG). Author: Juerg Schwizer

Hi Felix, many thanks for the feedback! Bug 1 is already implemented together with additional tex elements. These changes will soon be published together with a minor label bugfix. I was not able to reproduce bug 2 & 3. Could you please send me an example. Many thanks. Juerg.

12 Aug 2009 Scalable Vector Graphics (SVG) Export of Figures Converts 3D and 2D MATLAB plots to the scalable vector format (SVG). Author: Juerg Schwizer

Hi Cesar Roda Neve,
This is not a bug in plot2svg. It's a limitation of Inkscape and Firefox. Other browsers like Opera or Chrome can handle it. The SVG code for sub and super script is conform to the SVG 1.1 specification. I'm aware of the limitation and will try to find a workaround for Inkscape and Firefox.

Comments and Ratings on Juerg Schwizer's Files View all
Updated File Comment by Comments Rating
30 Nov 2014 Scalable Vector Graphics (SVG) Export of Figures Converts 3D and 2D MATLAB plots to the scalable vector format (SVG). Author: Juerg Schwizer Juerg Schwizer

To all Matlab R2014b users:

As the graphic engine of Matlab R2014b contains major changes some functionality is no more compatible. The svg format is finally supported natively. Unfortunately, the resulting files are sometimes very big. The latest version of plot2svg can be found on git

https://github.com/jschwizer99/plot2svg

The current version available contains first changes needed for Matlab R2014b support. Please also report bugs there.

27 Nov 2014 Scalable Vector Graphics (SVG) Export of Figures Converts 3D and 2D MATLAB plots to the scalable vector format (SVG). Author: Juerg Schwizer Valentin

Dear Juerg, thanks for this great contribution. Are you still interested in bug fixes?

If the axes are in log scale, only the minor grids lower than the biggest tick are plotted. However, if you want to continue the minor grid, you can replace

axxtick = log10(get(ax,'XTick'));
minor_axxtick = [];
if ~isempty(axxtick_w)
all_axxtick = axxtick(1):1:axxtick(end);
for stick = all_axxtick
minor_axxtick = [minor_axxtick minor_log_sticks + stick];
end
end
minor_axxtick = minor_axxtick(find(minor_axxtick > min(axlimx) & minor_axxtick < max(axlimx)));

around line 940 with

axxtick = log10(get(ax,'XTick'));
minor_axxtick = [];
%if ~isempty(axxtick_w)
%all_axxtick = axxtick(1):1:axxtick(end);
all_axxtick = ceil(min(axlimx)):1:ceil(max(axlimx));
for stick = all_axxtick
minor_axxtick = [minor_axxtick minor_log_sticks + stick];
end
%end
minor_axxtick = minor_axxtick(find(minor_axxtick > min(axlimx) & minor_axxtick < max(axlimx)));

(and for the y and z axis respectively). I personally consider this as a bug, but maybe this original behavior was intended.

25 Nov 2014 Scalable Vector Graphics (SVG) Export of Figures Converts 3D and 2D MATLAB plots to the scalable vector format (SVG). Author: Juerg Schwizer NGUYEN

Dear Juerg,
First, i would like to thank you for sharing a great tool.

I have the following problem with a figure of dimension 3 could you help me to fix it please!

Subscript indices must either be real positive integers or logicals.

Error in plot2svg>axchild2svg (line 1481)
[z,face_index]=sort(sum(z(faces(:,:)),2));

Error in plot2svg>axes2svg (line 1062)
group = axchild2svg(fid,id,axIdString,ax,group,paperpos,axchild,axpos,groupax,projection,boundingBoxAxes);

Error in plot2svg (line 243)
group=axes2svg(fid,id,ax(j),group,paperpos);

Thanks a lot

17 Nov 2014 Scalable Vector Graphics (SVG) Export of Figures Converts 3D and 2D MATLAB plots to the scalable vector format (SVG). Author: Juerg Schwizer Rodolphe

Same as Richard, i have the "Warning: Unhandled main figure child type". If anybody has a fix...

11 Nov 2014 Scalable Vector Graphics (SVG) Export of Figures Converts 3D and 2D MATLAB plots to the scalable vector format (SVG). Author: Juerg Schwizer Neil Dalchau

This is a brilliant contribution. Thank you!

I have found a bug with reproducing textbox annotations. The left-hand edge is not reproduced. A simple example is:

annotation('textbox',[0.2 0.3 0.6 0.4],'String','test')
plot2svg('test.svg')

Contact us