changeset 9257:ab952265ad06

__go_draw_axes__.m: Properly render TeX symbols for x11.
author Ben Abbott <bpabbott@mac.com>
date Mon, 25 May 2009 18:04:11 -0400
parents 5c05996ee4ac
children a653c61ee98c
files scripts/ChangeLog scripts/plot/__go_draw_axes__.m
diffstat 2 files changed, 17 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Mon May 25 13:03:08 2009 -0700
+++ b/scripts/ChangeLog	Mon May 25 18:04:11 2009 -0400
@@ -1,3 +1,8 @@
+2009-05-25  Ben Abbott <bpabbott@mac.com>
+
+	* plot/__go_draw_axes__.m: Properly render TeX symbols for x11, when
+	using the anonymous fontname="*".
+
 2009-05-24 Benjamin Lindner <lindnerb@users.sourceforge.net>
 
 	* plot/gnuplot_drawnow.m: single-quote output name to allow backslash
--- a/scripts/plot/__go_draw_axes__.m	Mon May 25 13:03:08 2009 -0700
+++ b/scripts/plot/__go_draw_axes__.m	Mon May 25 18:04:11 2009 -0400
@@ -36,6 +36,7 @@
     end_unwind_protect
 
     parent_figure_obj = get (axis_obj.parent);
+    gnuplot_term = __gnuplot_get_var__ (axis_obj.parent, "GPVAL_TERM");
 
     ## Set to false for plotyy axes.
     if (strcmp (axis_obj.tag, "plotyy"))
@@ -95,7 +96,7 @@
 	fputs (plot_stream, "unset title;\n");
       else
 	[tt, f, s] = __maybe_munge_text__ (enhanced, t, "string");
-	fontspec = create_fontspec (f, s);
+	fontspec = create_fontspec (f, s, gnuplot_term);
 	fprintf (plot_stream, "set title \"%s\" %s %s",
 		 undo_string_escapes (tt), fontspec,
 		 __do_enhanced_option__ (enhanced, t));
@@ -116,7 +117,7 @@
 	fprintf (plot_stream, "unset x2label;\n");
       else
 	[tt, f, s] = __maybe_munge_text__ (enhanced, t, "string");
-	fontspec = create_fontspec (f, s);
+	fontspec = create_fontspec (f, s, gnuplot_term);
 	if (strcmpi (axis_obj.xaxislocation, "top"))
 	  fprintf (plot_stream, "set x2label \"%s\" %s %s %s",
 		   undo_string_escapes (tt), colorspec, fontspec,
@@ -144,7 +145,7 @@
 	fprintf (plot_stream, "unset y2label;\n");
       else
 	[tt, f, s] = __maybe_munge_text__ (enhanced, t, "string");
-	fontspec = create_fontspec (f, s);
+	fontspec = create_fontspec (f, s, gnuplot_term);
 	if (strcmpi (axis_obj.yaxislocation, "right"))
 	  fprintf (plot_stream, "set y2label \"%s\" %s %s %s",
 		   undo_string_escapes (tt), colorspec, fontspec,
@@ -171,7 +172,7 @@
 	fputs (plot_stream, "unset zlabel;\n");
       else
 	[tt, f, s] = __maybe_munge_text__ (enhanced, t, "string");
-	fontspec = create_fontspec (f, s);
+	fontspec = create_fontspec (f, s, gnuplot_term);
 	fprintf (plot_stream, "set zlabel \"%s\" %s %s %s",
 		 undo_string_escapes (tt), colorspec, fontspec,
 		 __do_enhanced_option__ (enhanced, t));
@@ -258,7 +259,7 @@
       fputs (plot_stream, "unset grid;\n");
     endif
 
-    do_tics (axis_obj, plot_stream, ymirror, mono);
+    do_tics (axis_obj, plot_stream, ymirror, mono, gnuplot_term);
 
     xlogscale = strcmpi (axis_obj.xscale, "log");
     if (xlogscale)
@@ -992,7 +993,7 @@
 
 	case "text"
 	  [label, f, s] = __maybe_munge_text__ (enhanced, obj, "string");
-	  fontspec = create_fontspec (f, s);
+	  fontspec = create_fontspec (f, s, gnuplot_term);
 	  lpos = obj.position;
 	  halign = obj.horizontalalignment;
 	  angle = obj.rotation;
@@ -1210,7 +1211,7 @@
 	  pos = "";
       endswitch
       if (__gnuplot_has_feature__ ("key_has_font_properties"))
-        fontspec = create_fontspec (axis_obj.fontname, axis_obj.fontsize);
+        fontspec = create_fontspec (axis_obj.fontname, axis_obj.fontsize, gnuplot_term);
       else
 	fontspec = "";
       endif
@@ -1323,8 +1324,8 @@
 
 endfunction
 
-function fontspec = create_fontspec (f, s)
-  if (strcmp (f, "*"))
+function fontspec = create_fontspec (f, s, gp_term)
+  if (strcmp (f, "*") && ! strcmp (gp_term, "x11"))
     fontspec = sprintf ("font \",%d\"", s);
   else
     fontspec = sprintf ("font \"%s,%d\"", f, s);
@@ -1516,14 +1517,14 @@
 
 endfunction
 
-function do_tics (obj, plot_stream, ymirror, mono)
+function do_tics (obj, plot_stream, ymirror, mono, gnuplot_term)
 
   obj.xticklabel = ticklabel_to_cell (obj.xticklabel);
   obj.yticklabel = ticklabel_to_cell (obj.yticklabel);
   obj.zticklabel = ticklabel_to_cell (obj.zticklabel);
 
   [fontname, fontsize] = get_fontname_and_size (obj);
-  fontspec = create_fontspec (fontname, fontsize);
+  fontspec = create_fontspec (fontname, fontsize, gnuplot_term);
 
   ## A Gnuplot tic scale of 69 is equivalent to Octave's 0.5.
   ticklength = sprintf ("scale %4.1f", (69/0.5)*obj.ticklength(1));