# HG changeset patch # User David Bateman # Date 1297002836 -3600 # Node ID f16a5244d93a62de91d2c0bad7e99a7a414bc878 # Parent 2e74073b57917b3633a51a18edcfaee9912506fa Delete old legends and fix for legend locations that are 'southest' (followup #32343) diff -r 2e74073b5791 -r f16a5244d93a 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 2e74073b5791 -r f16a5244d93a 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)];