kupiqu/fig2svg

plot2svg do not work in matlab R2015b

Closed this issue · 3 comments

I download this function, and run the "tutorial_plot2svg" in matlab R2015b. Howerver, it is not successfull. The error is shown as followings:

`Forked FIG to SVG converter version 09-Jul-2018, maintained by Salva Ardid (sardid@bu.edu).
Most credit to Juerg Schwizer (converter@bluewin.ch).
Error using matlab.graphics.illustration.Legend/set
There is no AutoUpdate property on the Legend class.

Error in plot2svg (line 210)
set(ax(j),'AutoUpdate','off'); % sometimes weird things happen with legends including patches (e.g., bar graphs) if not used

Error in tutorial_plot2svg (line 33)
plot2svg('temperature_standard.svg');`

I could not find a solution to this error. Is this version "plot2svg" function not compatible with matlab r2015b? Thanks for your replies.

It's weird, I cannot reproduce this in Matlab R2018a and I don't see why this should be different in Matlab 2015b.

Note that I didn't touch the "tutorial_plot2svg" at all in my forked version. Suport for legends in Matlab > 2014a is something I added. To make them appear in the SVG file as they appear in Matlab, one should follow the instructions of the warnings below, and consequently update "tutorial_plot2svg" (which is not sth I will surely do anytime soon, or ever).

Can you test instead "test_legend_and_clipping" ?

>> tutorial_plot2svg
   Forked FIG to SVG converter version 09-Jul-2018, maintained by Salva Ardid (sardid@bu.edu).
   Most credit to Juerg Schwizer (converter@bluewin.ch).
Warning: For proper results when lines and patches are present in a figure, pass the legend icons to plot2svg
function as a fourth argument, e.g., plot2svg('filename.svg','','',legendIcons)
Legend icons can be grabbed by calling legend in the following way: [lgd,legendIcons] = legend(...);
> In plot2svg (line 236)
  In tutorial_plot2svg (line 33)
   Forked FIG to SVG converter version 09-Jul-2018, maintained by Salva Ardid (sardid@bu.edu).
   Most credit to Juerg Schwizer (converter@bluewin.ch).
Warning: For proper results when lines and patches are present in a figure, pass the legend icons to plot2svg
function as a fourth argument, e.g., plot2svg('filename.svg','','',legendIcons)
Legend icons can be grabbed by calling legend in the following way: [lgd,legendIcons] = legend(...);
> In plot2svg (line 236)
  In tutorial_plot2svg (line 49)
   Forked FIG to SVG converter version 09-Jul-2018, maintained by Salva Ardid (sardid@bu.edu).
   Most credit to Juerg Schwizer (converter@bluewin.ch).
Warning: For proper results when lines and patches are present in a figure, pass the legend icons to plot2svg
function as a fourth argument, e.g., plot2svg('filename.svg','','',legendIcons)
Legend icons can be grabbed by calling legend in the following way: [lgd,legendIcons] = legend(...);
> In plot2svg (line 236)
  In tutorial_plot2svg (line 62)

fixed with commit c5e556d