changeset 25198:5251de3c34d7

Center label if only one value is given for a pie chart. * __pie__.m: Use HorizontalAlignment value of "center" if there is only a single value for the entire pie chart.
author Rik <rik@octave.org>
date Tue, 10 Apr 2018 15:46:07 -0700
parents ff830f8e61ac
children 6afed459d063
files scripts/plot/draw/private/__pie__.m
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/draw/private/__pie__.m	Tue Apr 10 15:43:16 2018 -0700
+++ b/scripts/plot/draw/private/__pie__.m	Tue Apr 10 15:46:07 2018 -0700
@@ -131,8 +131,10 @@
     elseif (strcmp (caller, "pie"))
       if (xt > 0)
         align = "left";
+      elseif (xt < 0)
+        align = "right";
       else
-        align = "right";
+        align = "center";
       endif
 
       hlist = [hlist; patch(xoff + [0, -sind(xn)], yoff + [0, cosd(xn)], i);