changeset 18774:8b90d4be063b stable

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.
author Rik <rik@octave.org>
date Wed, 07 May 2014 20:49:25 -0700
parents a9bb634679f8
children e5ab507687ee
files scripts/plot/util/private/__go_draw_axes__.m
diffstat 1 files changed, 1 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- 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);