[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ticklabels patch
From: |
Juhani Saastamoinen |
Subject: |
ticklabels patch |
Date: |
Mon, 25 Jun 2007 17:43:48 +0300 |
User-agent: |
Thunderbird 2.0.0.4 (X11/20070615) |
Hi,
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
Jussi
--- /usr/local/octaveCVS/share/octave/2.9.12+/m/plot/__go_draw_axes__.m
2007-06-25 13:12:40.000000000 +0300
+++ juhani/Plotting_DET/__go_draw_axes__.m 2007-06-25 17:26:37.000000000
+0300
@@ -906,35 +906,49 @@
endfunction
function do_tics_1 (ticmode, tics, labelmode, labels, ax, plot_stream)
- if (strcmp (ticmode, "manual"))
+if (strcmp (ticmode, "manual"))
if (isempty (tics))
- fprintf (plot_stream, "unset %stics;\n", ax);
+ fprintf (plot_stream, "unset %stics;\n", ax);
elseif (strcmp (labelmode, "manual") && ! isempty (labels))
- k = 1;
- ntics = numel (tics);
- nlabels = numel (labels);
- if (iscellstr (labels))
- fprintf (plot_stream, "set format %s \"%%s\";\n", ax);
- fprintf (plot_stream, "set %stics (", ax);
- for i = 1:ntics
- fprintf (plot_stream, " \"%s\" %g", labels(k++), tics(i))
- if (i < ntics)
- fputs (plot_stream, ", ");
- endif
- if (k > nlabels)
- k = 1;
- endif
- endfor
- fputs (plot_stream, ");\n");
- else
- error ("unsupported type of ticklabel");
- endif
+ k = 1;
+ ntics = numel (tics);
+ nlabels = numel (labels);
+ if (iscellstr (labels))
+ fprintf (plot_stream, "set format %s \"%%s\";\n", ax);
+ fprintf (plot_stream, "set %stics (", ax);
+ for i = 1:ntics
+ fprintf (plot_stream, " \"%s\" %g", labels(k++), tics(i))
+ if (i < ntics)
+ fputs (plot_stream, ", ");
+ endif
+ if (k > nlabels)
+ k = 1;
+ endif
+ endfor
+ fputs (plot_stream, ");\n");
+ elseif (ischar(labels))
+ fprintf (plot_stream, "set format %s \"%%s\";\n", ax);
+ fprintf (plot_stream, "set %stics (", ax);
+ for i = 1:ntics
+ fprintf (plot_stream, " \"%s\" %g", labels(k++, :), tics(i))
+ if (i < ntics)
+ fputs (plot_stream, ", ");
+ endif
+ if (k > nlabels)
+ k = 1;
+ endif
+ endfor
+ fputs (plot_stream, ");\n");
+ else
+ error ("unsupported type of ticklabel");
+ endif
else
- fprintf (plot_stream, "set %stics (", ax);
- fprintf (plot_stream, " %g,", tics(1:end-1));
- fprintf (plot_stream, " %g);\n", tics(end));
+ fprintf (plot_stream, "set %stics (", ax);
+ fprintf (plot_stream, " %g,", tics(1:end-1));
+ fprintf (plot_stream, " %g);\n", tics(end));
endif
- else
+else
fprintf (plot_stream, "set %stics;\n", ax);
- endif
+endif
endfunction
+
- ticklabels patch,
Juhani Saastamoinen <=