octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ticklabels patch


From: John W. Eaton
Subject: ticklabels patch
Date: Mon, 25 Jun 2007 11:11:01 -0400

On 25-Jun-2007, Juhani Saastamoinen wrote:

| Find attached a patch which allows
| setting ticklabels from character matrix.
| Matlab allows it, e.g. NIST DETware does so,
| see http://www.nist.gov/speech/tools/index.htm

Thanks for the patch.

I did it in a slightly different way to avoid duplicating code (see below).

When submitting patches, please don't change the indentation style of
existing code, and please do include a ChangeLog entry.

Thanks,

jwe


Index: scripts/plot/__go_draw_axes__.m
===================================================================
RCS file: /cvs/octave/scripts/plot/__go_draw_axes__.m,v
retrieving revision 1.25
diff -u -u -r1.25 __go_draw_axes__.m
--- scripts/plot/__go_draw_axes__.m     20 Jun 2007 17:44:35 -0000      1.25
+++ scripts/plot/__go_draw_axes__.m     25 Jun 2007 15:10:30 -0000
@@ -910,10 +910,13 @@
     if (isempty (tics))
       fprintf (plot_stream, "unset %stics;\n", ax);
     elseif (strcmp (labelmode, "manual") && ! isempty (labels))
-      k = 1;
-      ntics = numel (tics);
-      nlabels = numel (labels);
+      if (ischar (labels))
+       labels = cellstr (labels);
+      endif
       if (iscellstr (labels))
+       k = 1;
+       ntics = numel (tics);
+       nlabels = numel (labels);
        fprintf (plot_stream, "set format %s \"%%s\";\n", ax);
        fprintf (plot_stream, "set %stics (", ax);
        for i = 1:ntics

reply via email to

[Prev in Thread] Current Thread [Next in Thread]