# HG changeset patch # User David Bateman # Date 1297002836 -3600 # Node ID cf9ca0dbc5ee354f4ae06d67768e2f616d0f8af1 # Parent 5fb6ea1bff6555d51e8ff34a53f67835fc17652c Delete old legends and fix for legend locations that are 'southest' (followup #32343) diff -r 5fb6ea1bff65 -r cf9ca0dbc5ee scripts/ChangeLog --- a/scripts/ChangeLog Sun Feb 06 09:16:03 2011 -0500 +++ b/scripts/ChangeLog Sun Feb 06 15:33:56 2011 +0100 @@ -1,3 +1,8 @@ +2011-02-06 David Bateman + * plot/legend.m : Delete old legend before probing the position and + outerposition. Reshape lpos correct if the legend locqtion is + "southeast". + 2011-02-06 Ben Abbott * plot/legend.m: Add demo for replacing existing legend. diff -r 5fb6ea1bff65 -r cf9ca0dbc5ee scripts/plot/legend.m --- a/scripts/plot/legend.m Sun Feb 06 09:16:03 2011 -0500 +++ b/scripts/plot/legend.m Sun Feb 06 15:33:56 2011 +0100 @@ -410,6 +410,9 @@ endif box = get (hlegend, "box"); fkids = get (fig, "children"); + + delete (hlegend); + hlegend = []; else if (strcmp (textpos, "default")) textpos = "left"; @@ -612,7 +615,7 @@ endif case "southeast" if (outside) - lpos = [ca_outpos(1) + ca_outpos(3) - lpos(3), ca_outpos(2), + lpos = [ca_outpos(1) + ca_outpos(3) - lpos(3), ca_outpos(2), ... lpos(3), lpos(4)]; new_pos = [ca_pos(1), ca_pos(2) + lpos(4), ... ca_pos(3) - lpos(3), ca_pos(4) - lpos(4)];