octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fwd: Re: Stem update, rough guess.]


From: Daniel J Sebald
Subject: [Fwd: Re: Stem update, rough guess.]
Date: Fri, 06 Apr 2007 21:46:15 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020

John W. Eaton wrote:

The patch you sent seems to include changes that have already been
checked in.  Can you please sort that out and submit a new patch that
is relative to the current CVS sources?

I changed things slightly and put the "markerfacecolor" in the list of the plot
characteristics.  It issues a warning message, which should be a good reminder
actually.

Dan
--- /usr/local/share/octave/2.9.10+/m/plot/stem.m       2007-04-06 
19:59:04.010503982 -0500
+++ ./stem.m    2007-04-06 21:21:01.877543534 -0500
@@ -30,7 +30,7 @@
 ## stem (x);
 ## @end example
 ## @noindent
-## plots 10 stems with hights from 1 to 10;
+## plots 10 stems with heights from 1 to 10;
 ##
 ## @example
 ## x = 1:10;
@@ -38,7 +38,7 @@
 ## stem (x, y);
 ## @end example
 ## @noindent
-## plots 10 stems with hights from 2 to 20;
+## plots 10 stems with heights from 2 to 20;
 ## 
 ## @example
 ## x = 1:10;
@@ -46,7 +46,7 @@
 ## h = stem (x, y, "b");
 ## @end example
 ## @noindent
-## plots 10 bars with hights from 2 to 20
+## plots 10 bars with heights from 2 to 20
 ## (the color is blue, and @var{h} is a 2-by-10 array of handles in
 ## which the first row holds the line handles and the 
 ## the second row holds the marker handles);
@@ -57,7 +57,7 @@
 ## h = stem (x, y, "-.k");
 ## @end example
 ## @noindent
-## plots 10 stems with hights from 2 to 20
+## plots 10 stems with heights from 2 to 20
 ## (the color is black, line style is @code{"-."}, and @var{h} is a 2-by-10
 ## array of handles in which the first row holds the line handles and
 ## the second rows holds the marker handles);
@@ -68,7 +68,7 @@
 ## h = stem (x, y, "-.k.");
 ## @end example
 ## @noindent
-## plots 10 stems with hights from 2 to 20
+## plots 10 stems with heights from 2 to 20
 ## (the color is black, line style is @code{"-."} and the marker style
 ## is @code{"."}, and @var{h} is a 2-by-10 array of handles in which the
 ## first row holds the line handles and the second row holds the marker
@@ -102,14 +102,45 @@
 
   [x, y, dofill, lc, ls, mc, ms] = check_stem_arg (varargin{:});
 
+  if (dofill)
+    fc = mc;
+  else
+    fc = "none";
+  endif
+
+  ## FIXME:  The markerfacecolor isn't implemented yet, so here is a temporary
+  ## fix.  Remove when the markerfacecolor option is properly handled.
+  if (dofill)
+    if (ms == "o")
+      ms = ".";
+    elseif (ms == ">")
+      ms = "^";
+    elseif (ms == "<")
+      ms = "v";
+    elseif (ms == "p")
+      ms = "s";
+    endif
+  endif
+
   newplot ();
 
-  z = zeros (1, numel (x)));
+  z = zeros (1, numel (x));
   xt = x(:)';
   yt = y(:)';
   tmp = plot ([xt; xt], [z; yt], "color", lc, "linestyle", ls,
-             x, y, "color", mc, "marker", ms, "linestyle", "");
+             x, y, "color", mc, "marker", ms, "linestyle", "",
+             "markerfacecolor", fc);
 
+  ## FIXME:  A property should be added to handle adding a line at the
+  ## x-axis and use the following set command:
+#  set (gca, "?axisline?", "on");
+  ## Here is what the property should do.  Note that the first time
+  ## this is called, the __plot_stream__ = [] so there will be an
+  ## error.  (Could the plot stream be initialized inside newplot.m
+  ## rather than __go_draw_axes__.m?)
+  plot_stream = get (gcf, "__plot_stream__");
+  fputs (plot_stream, "set xzeroaxis linetype -1 linewidth 0.5;\nreplot;\n");
+ 
   if (nargout > 0)
     h = tmp;
   endif


reply via email to

[Prev in Thread] Current Thread [Next in Thread]