changeset 6738:b8d188455f2f

[project @ 2007-06-15 21:54:18 by jwe]
author jwe
date Fri, 15 Jun 2007 21:54:19 +0000
parents 7888712d3532
children db0a05a61d09
files scripts/ChangeLog scripts/plot/__go_draw_axes__.m
diffstat 2 files changed, 27 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Fri Jun 15 21:45:50 2007 +0000
+++ b/scripts/ChangeLog	Fri Jun 15 21:54:19 2007 +0000
@@ -1,3 +1,8 @@
+2007-06-15  John W. Eaton  <jwe@octave.org>
+
+	* plot/__go_draw_axes__.m: Only attempt label rotation if
+	have_newer_gnuplot is true.
+
 2007-06-15  Pete Gustafson  <petegus@umich.edu>
 
         * plot/__go_draw_axes__.m  Handle rotation arg for axis labels.
--- a/scripts/plot/__go_draw_axes__.m	Fri Jun 15 21:45:50 2007 +0000
+++ b/scripts/plot/__go_draw_axes__.m	Fri Jun 15 21:54:19 2007 +0000
@@ -72,9 +72,14 @@
       if (isempty (t.string))
 	fputs (plot_stream, "unset xlabel;\n");
       else
-	## Rotation of xlabel not yet support by gnuplot as of 4.2.
-	fprintf (plot_stream, "set xlabel \"%s\" rotate by %f;\n",
-		 undo_string_escapes (t.string), angle)
+	fprintf (plot_stream, "set xlabel \"%s\"",
+		 undo_string_escapes (t.string));
+	if (have_newer_gnuplot)
+	  ## Rotation of xlabel not yet support by gnuplot as of 4.2, but
+	  ## there is no message about it.
+	  fprintf (plot_stream, " rotate by %f", angle);
+	endif
+	fputs (plot_stream, ";\n");
       endif
     endif
 
@@ -84,8 +89,12 @@
       if (isempty (t.string))
 	fputs (plot_stream, "unset ylabel;\n");
       else
-	fprintf (plot_stream, "set ylabel \"%s\" rotate by %f;\n",
-		 undo_string_escapes (t.string), angle)
+	fprintf (plot_stream, "set ylabel \"%s\"",
+		 undo_string_escapes (t.string));
+	if (have_newer_gnuplot)
+	  fprintf (" rotate by %f;\n", angle);
+	endif
+	fputs (plot_stream, ";\n");
       endif
     endif
 
@@ -95,9 +104,14 @@
       if (isempty (t.string))
 	fputs (plot_stream, "unset zlabel;\n");
       else
-	## Rotation of zlabel not yet support by gnuplot as of 4.2.
-	fprintf (plot_stream, "set zlabel \"%s\" rotate by %f;\n",
-		 undo_string_escapes (t.string), angle)
+	fprintf (plot_stream, "set zlabel \"%s\"",
+		 undo_string_escapes (t.string));
+	if (have_newer_gnuplot)
+	  ## Rotation of zlabel not yet support by gnuplot as of 4.2, but
+	  ## there is no message about it.
+	  fprintf (plot_stream, " rotate by %f;\n", angle);
+	endif
+	fputs (plot_stream, ";\n");
       endif
     endif