diff scripts/plot/__go_draw_axes__.m @ 7271:c18512d0ddb6

[project @ 2007-12-10 06:52:51 by jwe]
author jwe
date Mon, 10 Dec 2007 06:52:51 +0000
parents 3fade00a6ac7
children 44fdc33e5207
line wrap: on
line diff
--- a/scripts/plot/__go_draw_axes__.m
+++ b/scripts/plot/__go_draw_axes__.m
@@ -268,6 +268,7 @@
     data = cell ();
     is_image_data = [];
     hidden_removal = NaN;
+    view_map = false;
 
     xlim = axis_obj.xlim;
     ylim = axis_obj.ylim;
@@ -305,6 +306,7 @@
 
 	  if (use_gnuplot_for_images)
 
+	    fputs (plot_stream, "set border front;\n");
 	    data_idx++;
 	    is_image_data(data_idx) = true;
 	    parametric(data_idx) = false;
@@ -789,6 +791,7 @@
 
 	case "surface"
 	  nd = 3;
+	  view_map = true;
           if (! (strncmp (obj.edgecolor, "none", 4)
 		 && strncmp (obj.facecolor, "none", 4)))
 	    data_idx++;
@@ -1170,7 +1173,11 @@
 	  rot_z += 360;
 	endwhile
  	fputs (plot_stream, "set ticslevel 0;\n");
-	fprintf (plot_stream, "set view %.15g, %.15g;\n", rot_x, rot_z);
+	if (view_map && rot_x == 0 && rot_z == 0)
+	  fputs (plot_stream, "set view map;\n");
+	else
+	  fprintf (plot_stream, "set view %.15g, %.15g;\n", rot_x, rot_z);
+	endif
       endif
       fprintf (plot_stream, "%s \"-\" %s %s %s \\\n", plot_cmd,
 	       usingclause{1}, titlespec{1}, withclause{1});
@@ -1191,6 +1198,11 @@
       fputs (plot_stream, "plot \"-\";\nInf Inf\ne\n");
     endif
 
+    ## Needed to allow mouse rotation with pcolor
+    if (view_map)
+      fputs (plot_stream, "unset view;\n");
+    endif
+
     fflush (plot_stream);
 
   else