changeset 7257:e8a3e3e33490

[project @ 2007-12-05 01:18:41 by jwe]
author jwe
date Wed, 05 Dec 2007 01:18:42 +0000
parents be3280acbdb8
children ab394b6ed06d
files doc/ChangeLog doc/interpreter/Makefile.in doc/interpreter/geometryimages.m doc/interpreter/interpimages.m doc/interpreter/plotimages.m doc/interpreter/sparseimages.m scripts/ChangeLog scripts/plot/__go_draw_axes__.m src/ChangeLog src/oct-hist.cc
diffstat 10 files changed, 72 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/doc/ChangeLog	Wed Dec 05 01:08:17 2007 +0000
+++ b/doc/ChangeLog	Wed Dec 05 01:18:42 2007 +0000
@@ -1,5 +1,16 @@
 2007-12-04  John W. Eaton  <jwe@octave.org>
 
+	* interpreter/sparseimages.m, interpreter/plotimages.m,
+	interpreter/interpimages.m, interpreter/geometryimages.m:
+	Set default text font to "*" for png images.
+
+	* interpreter/Makefile.in (run-octave): Don't sleep.
+
+2007-12-04  Joseph P. Skudlarek  <Jskud@Jskud.com>
+
+	* interpreter/plotimages.m: Generate text plots.
+	* interpreter/sparseimages.m: Add initial blank line to text plots.
+
 	* interpreter/Makefile.in (IMAGES_TXT): Include $(INTERPIMAGES_TXT)
 	$(GEOMETRYIMAGES_TXT) and $(PLOTIMAGES_TXT) in the list.
 	(INTERPIMAGES_TXT, GEOMETRYIMAGES_TXT, PLOTIMAGES_TXT): New variables.
--- a/doc/interpreter/Makefile.in	Wed Dec 05 01:08:17 2007 +0000
+++ b/doc/interpreter/Makefile.in	Wed Dec 05 01:18:42 2007 +0000
@@ -245,11 +245,9 @@
 	fi
 	cp $(filter-out html-dir, $<) HTML
 
-## Sleep for a second after plotting to allow gnuplot to finish
-## writing its output before Octave exits.
 define run-octave
   $(TOPDIR)/run-octave -f -q -H -p $(srcdir) \
-    --eval "$(notdir $(basename $<)) ('$(notdir $(basename $@))', '$(patsubst .%,%, $(suffix $@))'); sleep (1);"
+    --eval "$(notdir $(basename $<)) ('$(notdir $(basename $@))', '$(patsubst .%,%, $(suffix $@))');"
 endef
 
 $(GEOMETRYIMAGES_EPS) $(GEOMETRYIMAGES_PNG) $(GEOMETRYIMAGES_TXT): geometryimages.m
--- a/doc/interpreter/geometryimages.m	Wed Dec 05 01:08:17 2007 +0000
+++ b/doc/interpreter/geometryimages.m	Wed Dec 05 01:18:42 2007 +0000
@@ -18,6 +18,9 @@
 
 function geometryimages (nm, typ)
   bury_output ();
+  if (strcmp (typ, "png"))
+    set (0, "defaulttextfontname", "*");
+  endif
   if (isempty (findstr (octave_config_info ("DEFS"), "HAVE_QHULL"))
       && (strcmp (nm, "voronoi") || strcmp (nm, "griddata")
 	  || strcmp (nm, "convhull") || strcmp (nm, "delaunay")
--- a/doc/interpreter/interpimages.m	Wed Dec 05 01:08:17 2007 +0000
+++ b/doc/interpreter/interpimages.m	Wed Dec 05 01:18:42 2007 +0000
@@ -18,6 +18,9 @@
 
 function interpimages (nm, typ)
   bury_output ();
+  if (strcmp (typ, "png"))
+    set (0, "defaulttextfontname", "*");
+  endif
   if (strcmp (nm, "interpft"))
     t = 0 : 0.3 : pi; dt = t(2)-t(1);
     n = length (t); k = 100;
--- a/doc/interpreter/plotimages.m	Wed Dec 05 01:08:17 2007 +0000
+++ b/doc/interpreter/plotimages.m	Wed Dec 05 01:18:42 2007 +0000
@@ -18,6 +18,9 @@
 
 function plotimages (nm, typ)
   bury_output ();
+  if (strcmp (typ, "png"))
+    set (0, "defaulttextfontname", "*");
+  endif
   if (strcmp(typ , "txt"))
     image_as_txt(nm);
   elseif (strcmp (nm, "plot"))
--- a/doc/interpreter/sparseimages.m	Wed Dec 05 01:08:17 2007 +0000
+++ b/doc/interpreter/sparseimages.m	Wed Dec 05 01:18:42 2007 +0000
@@ -17,6 +17,9 @@
 ## <http://www.gnu.org/licenses/>.
 
 function sparseimages (nm, typ)
+  if (strcmp (typ, "png"))
+    set (0, "defaulttextfontname", "*");
+  endif
   if (! isempty (findstr (octave_config_info ("DEFS"), "HAVE_COLAMD"))
       && ! isempty (findstr (octave_config_info ("DEFS"), "HAVE_CHOLMOD"))
       && ! isempty (findstr (octave_config_info ("DEFS"), "HAVE_UMFPACK")))
--- a/scripts/ChangeLog	Wed Dec 05 01:08:17 2007 +0000
+++ b/scripts/ChangeLog	Wed Dec 05 01:18:42 2007 +0000
@@ -1,5 +1,8 @@
 2007-12-04  John W. Eaton  <jwe@octave.org>
 
+	* plot/__go_draw_axes__.m: Omit "font \"NAME,SIZE\"" in gnuplot
+	text and label commands if font is "*".
+
 	* linear-algebra/krylov.m: Doc fixes.
 	From Marco Caliari <caliari@sci.univr.it>.
 
--- a/scripts/plot/__go_draw_axes__.m	Wed Dec 05 01:08:17 2007 +0000
+++ b/scripts/plot/__go_draw_axes__.m	Wed Dec 05 01:18:42 2007 +0000
@@ -74,8 +74,13 @@
       else
 	[tt, f, s] = __maybe_munge_text__ (enhanced, t, "string", 
 					   have_newer_gnuplot);
-	fprintf (plot_stream, "set title \"%s\" font \"%s,%d\";\n",
-		 undo_string_escapes (tt), f, s);
+	if (strcmp (f, "*"))
+	  fontspec = "";
+	else
+	  fontspec = sprintf ("font \"%s,%d\"", f, s);
+	endif
+	fprintf (plot_stream, "set title \"%s\" %s;\n",
+		 undo_string_escapes (tt), fontspec);
       endif
     endif
 
@@ -89,12 +94,17 @@
       else
 	[tt, f, s] = __maybe_munge_text__ (enhanced, t, "string",
 					   have_newer_gnuplot);
+	if (strcmp (f, "*"))
+	  fontspec = "";
+	else
+	  fontspec = sprintf ("font \"%s,%d\"", f, s);
+	endif
 	if (strcmpi (axis_obj.xaxislocation, "top"))
-	  fprintf (plot_stream, "set x2label \"%s\" %s font \"%s,%d\"",
-		   undo_string_escapes (tt), colorspec, f, s);
+	  fprintf (plot_stream, "set x2label \"%s\" %s %s",
+		   undo_string_escapes (tt), colorspec, fontspec);
 	else
-	  fprintf (plot_stream, "set xlabel \"%s\" %s font \"%s,%d\"",
-		   undo_string_escapes (tt), colorspec, f, s);
+	  fprintf (plot_stream, "set xlabel \"%s\" %s %s",
+		   undo_string_escapes (tt), colorspec, fontspec);
 	endif
 	if (have_newer_gnuplot)
 	  ## Rotation of xlabel not yet support by gnuplot as of 4.2, but
@@ -120,12 +130,17 @@
       else
 	[tt, f, s] = __maybe_munge_text__ (enhanced, t, "string",
 					   have_newer_gnuplot);
+	if (strcmp (f, "*"))
+	  fontspec = "";
+	else
+	  fontspec = sprintf ("font \"%s,%d\"", f, s);
+	endif
 	if (strcmpi (axis_obj.yaxislocation, "right"))
-	  fprintf (plot_stream, "set y2label \"%s\" %s font \"%s,%d\"",
-		   undo_string_escapes (tt), colorspec, f, s);
+	  fprintf (plot_stream, "set y2label \"%s\" %s %s",
+		   undo_string_escapes (tt), colorspec, fontspec);
 	else
-	  fprintf (plot_stream, "set ylabel \"%s\" %s font \"%s,%d\"",
-		   undo_string_escapes (tt), colorspec, f, s);
+	  fprintf (plot_stream, "set ylabel \"%s\" %s %s",
+		   undo_string_escapes (tt), colorspec, fontspec);
 	endif
 	if (have_newer_gnuplot)
 	  fprintf (plot_stream, " rotate by %f;\n", angle);
@@ -148,8 +163,13 @@
       else
 	[tt, f, s] = __maybe_munge_text__ (enhanced, t, "string",
 					   have_newer_gnuplot);
-	fprintf (plot_stream, "set zlabel \"%s\" %s font \"%s,%d\"",
-		 undo_string_escapes (tt), colorspec, f, s);
+	if (strcmp (f, "*"))
+	  fontspec = "";
+	else
+	  fontspec = sprintf ("font \"%s,%d\"", f, s);
+	endif
+	fprintf (plot_stream, "set zlabel \"%s\" %s %s",
+		 undo_string_escapes (tt), colorspec, fontspec);
 	if (have_newer_gnuplot)
 	  ## Rotation of zlabel not yet support by gnuplot as of 4.2, but
 	  ## there is no message about it.
@@ -913,6 +933,11 @@
 	case "text"
 	  [label, f, s] = __maybe_munge_text__ (enhanced, obj, "string",
 						have_newer_gnuplot);
+	  if (strcmp (f, "*"))
+	    fontspec = "";
+	  else
+	    fontspec = sprintf ("font \"%s,%d\"", f, s);
+	  endif
 	  lpos = obj.position;
 	  halign = obj.horizontalalignment;
 	  angle = obj.rotation;
@@ -930,14 +955,14 @@
 
 	  if (nd == 3)
 	    fprintf (plot_stream,
-		     "set label \"%s\" at %s %.15g,%.15g,%.15g font \"%s,%d\" %s rotate by %f %s;\n",
+		     "set label \"%s\" at %s %.15g,%.15g,%.15g %s %s rotate by %f %s;\n",
 		     undo_string_escapes (label), units, lpos(1),
-		     lpos(2), lpos(3), f, s, halign, angle, colorspec);
+		     lpos(2), lpos(3), fontspec, halign, angle, colorspec);
 	  else
  	    fprintf (plot_stream,
- 		     "set label \"%s\" at %s %.15g,%.15g font \"%s,%d\" %s rotate by %f %s;\n",
+ 		     "set label \"%s\" at %s %.15g,%.15g %s %s rotate by %f %s;\n",
  		     undo_string_escapes (label), units,
- 		     lpos(1), lpos(2), f, s, halign, angle, colorspec);
+ 		     lpos(1), lpos(2), fontspec, halign, angle, colorspec);
 	  endif
 
 	otherwise
--- a/src/ChangeLog	Wed Dec 05 01:08:17 2007 +0000
+++ b/src/ChangeLog	Wed Dec 05 01:18:42 2007 +0000
@@ -1,5 +1,8 @@
 2007-12-04  John W. Eaton  <jwe@octave.org>
 
+	* src/oct-hist.cc (default_history_file): Use += instead of
+	push_back to append character to std::string object.
+
 	* Makefile.in (LIBDLFCN): Delete all uses.
 
 	* toplev.cc (octave_config_info): Remove LIBDLFCN and
--- a/src/oct-hist.cc	Wed Dec 05 01:08:17 2007 +0000
+++ b/src/oct-hist.cc	Wed Dec 05 01:18:42 2007 +0000
@@ -94,7 +94,7 @@
 	{
 	  file = home_dir;
 	  if (! file_ops::is_dir_sep (file[file.length()-1]))
-	    file.push_back (file_ops::dir_sep_char);
+	    file += file_ops::dir_sep_char;
 	  file.append (".octave_hist");
 	}
       else