Mercurial > hg > octave-lyh
comparison scripts/plot/legend.m @ 16800:56102c33122d
Fix problems with changeset 286904321282.
legend.m: Do not delete invisible legend text object. Fix typo.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Sat, 22 Jun 2013 13:38:03 +0800 |
parents | 286904321282 |
children | 2281d957cde6 |
comparison
equal
deleted
inserted
replaced
16799:286904321282 | 16800:56102c33122d |
---|---|
509 endif | 509 endif |
510 | 510 |
511 if (isempty (hplots)) | 511 if (isempty (hplots)) |
512 if (! isempty (hlegend)) | 512 if (! isempty (hlegend)) |
513 fkids = get (fig, "children"); | 513 fkids = get (fig, "children"); |
514 delete_legend (fkids(fkids == hlegend)); | 514 delete (fkids(fkids == hlegend)); |
515 hlegend = []; | 515 hlegend = []; |
516 hobjects = []; | 516 hobjects = []; |
517 hplots = []; | 517 hplots = []; |
518 text_strings = {}; | 518 text_strings = {}; |
519 endif | 519 endif |
867 ## Add an invisible text object to original axis | 867 ## Add an invisible text object to original axis |
868 ## that when it is destroyed will remove the legend | 868 ## that when it is destroyed will remove the legend |
869 props = {"parent", ca(1), "tag", "legend", ... | 869 props = {"parent", ca(1), "tag", "legend", ... |
870 "handlevisibility", "off", "visible", "off", ... | 870 "handlevisibility", "off", "visible", "off", ... |
871 "xliminclude", "off", "yliminclude", "off"}; | 871 "xliminclude", "off", "yliminclude", "off"}; |
872 t1 = findall (ca(1), props{:}, "type", "text"); | 872 t1 = findall (ca(1), props{3:4}, "type", "text"); |
873 if (isempty (t1)) | 873 if (isempty (t1)) |
874 ht = findall (ca(1), "type", "text", props{3:end}); | |
875 if (! isempty (ht)) | |
876 set (ht, "deletefcn", "") | |
877 delete (ht); | |
878 endif | |
879 t1 = text (0, 0, "", props{:}); | 874 t1 = text (0, 0, "", props{:}); |
880 set (t1, "deletefcn", {@deletelegend1, hlegend}); | 875 set (t1, "deletefcn", {@deletelegend1, hlegend}); |
881 endif | 876 endif |
882 if (isprop (hlegend, "unmodified_axes_position")) | 877 if (isprop (hlegend, "unmodified_axes_position")) |
883 set (hlegend, "unmodified_axes_position", unmodified_axes_position) | 878 set (hlegend, "unmodified_axes_position", unmodified_axes_position) |