changeset 17730:580990c2ce04

legend.m: Fix legend color for bar graphs (bug #40327) * scripts/plot/appearance/legend.m: Set clim on legend axis object to match that of axis to which it is attached.
author Rik <rik@octave.org>
date Tue, 22 Oct 2013 14:32:21 -0700
parents 76d6a523aae6
children f79bf671a493
files scripts/plot/appearance/legend.m
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/appearance/legend.m	Tue Oct 22 22:27:19 2013 +0200
+++ b/scripts/plot/appearance/legend.m	Tue Oct 22 14:32:21 2013 -0700
@@ -879,8 +879,11 @@
                            "facecolor", facecolor, "edgecolor", edgecolor,
                            "cdata", cdata, "userdata", hplots(k));
                 hobjects(end+1) = p1;
+                ## Copy clim from axes so that colors work out.
+                set (hlegend, "clim", get (ca(1), "clim"));
               endif
               ## FIXME: Probably need listeners, as for line objects
+              ##        Changing clim, for example, won't update colors
 
             case "surface"
               facecolor = get (hplots(k), "facecolor");