# HG changeset patch # User Rik # Date 1382477541 25200 # Node ID 580990c2ce0412dbc6bd8f7e71c1cccc002b9f0b # Parent 76d6a523aae6827a84c442fcf3eb0e684bdb54e3 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. diff -r 76d6a523aae6 -r 580990c2ce04 scripts/plot/appearance/legend.m --- 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");