# HG changeset patch # User Rik # Date 1399520965 25200 # Node ID 8b90d4be063bffba0c97edf10b10ac48f4003678 # Parent a9bb634679f8c63004369392cb2c68629942f2f9 Fix extra backslash escape for gnuplot when interpreter=none (bug #36744). Don't escape '_' or '^'. Instead send 'noenhanced' property to gnuplot. * __go_draw_axes__.m: Remove no_super_sub_scripts function, and rely on __do_enhanced__ instead. diff -r a9bb634679f8 -r 8b90d4be063b scripts/plot/util/private/__go_draw_axes__.m --- a/scripts/plot/util/private/__go_draw_axes__.m Mon May 05 10:09:50 2014 +0200 +++ b/scripts/plot/util/private/__go_draw_axes__.m Wed May 07 20:49:25 2014 -0700 @@ -2165,7 +2165,7 @@ tickdir, ticklength, axispos); endif - labels = regexprep (labels, '%', "%%"); + labels = strrep (labels, "%", "%%"); for i = 1:ntics fprintf (plot_stream, " \"%s\" %.15g", labels{k++}, tics(i)); if (i < ntics) @@ -2322,38 +2322,10 @@ warning ("latex markup not supported for text objects"); warned_latex = true; endif - elseif (enhanced) - str = no_super_sub_scripts (str); endif endif endfunction -function str = no_super_sub_scripts (str) - if (iscellstr (str)) - labels = str; - else - labels = cellstr (str); - endif - for marker = "_^" - for m = 1 : numel (labels) - n1 = strfind (labels{m}, sprintf ("\\%s", marker)); - n2 = strfind (labels{m}, marker); - if (! isempty (n1)) - n1 = n1 + 1; - n2 = setdiff (n2, n1); - endif - for n = numel (n2):-1:1 - labels{m} = [labels{m}(1:n2(n)-1), "\\", labels{m}(n2(n):end)]; - endfor - endfor - endfor - if (iscellstr (str)) - str = labels; - else - str = char (labels); - endif -endfunction - function str = __tex2enhanced__ (str, fnt, it, bld) persistent sym = __setup_sym_table__ (); persistent flds = fieldnames (sym);