octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #55859] [octave forge] (signal) zplane.m multi


From: Robert Jenssen
Subject: [Octave-bug-tracker] [bug #55859] [octave forge] (signal) zplane.m multiplicity annotations should not use superscript
Date: Sun, 10 Mar 2019 08:49:31 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36

Follow-up Comment #12, bug #55859 (project octave):

FYI I tried this patch:

---
octave-signal-f050d888e7efe5327e5ed702aed77a8d24448616/inst/zplane.m    
2019-03-07
15:02:59.000000000 +1100
+++ signal-tip/inst/zplane.m    2019-03-10 23:40:01.103212038 +1100
@@ -108,15 +108,30 @@
     colors = get (gca (), "colororder");
     for c = 1:columns (x)
       color = colors(mod (c, rows (colors)), :);
-      plot (real (x(:,c)), imag (x(:,c)), "color", color, ...
+      h=plot (real (x(:,c)), imag (x(:,c)), "color", color, ...
             "linestyle", "none", "marker", symbol);
 
+      % The marker is centred at x. The "markersize" property of the
+      % plot is in points. Scale markersize/2 to the range of the x-axis.
+      marker_size_points = get(h,"markersize");
+      x_range = diff(get(gca(),"xlim"));
+      current_units = get(gca(),"units");
+      current_activepositionproperty=get(gca(),"activepositionproperty");
+      set(gca(),"activepositionproperty","position"); 
+      set(gca(),"units","points");
+      current_position = get(gca(),"position");
+      set(gca(),"units",current_units);
+      set(gca(),"activepositionproperty",current_activepositionproperty);
+      x_range_points = current_position(3);
+      xshift = 1.5 * (marker_size_points/2) * (x_range/x_range_points);
+
       x_u = unique (x(:,c));
       for i = 1:length (x_u)
         n = sum (x_u(i) == x(:,c));
         if (n > 1)
-          label = sprintf (" ^%d", n);
-          text (real (x_u(i)), imag (x_u(i)), label, "color", color);
+          label = sprintf ("%d", n);
+          text (real (x_u(i)) + xshift, imag (x_u(i)), label, ...
+               "color", color, "verticalalignment", "bottom");
         endif
       endfor
     endfor


My guess is that, regardless of the value of "activepositionproperty",
get(gca(),"position") returns the size of the window rather than the plot. I
suspect that this is a bug.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55859>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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