Skip to content
This repository was archived by the owner on Apr 5, 2019. It is now read-only.
This repository was archived by the owner on Apr 5, 2019. It is now read-only.

objtodelete never set in legtools.remove #10

Closed
@sco1

Description

@sco1

When attempting to remove legend entries where there are no objects generated by legtools.adddummy present, legtools.remove will throw an error.

For example:

% Set up figure
x = 1:10;
y1 = x;
y2 = x + 1;
figure
plot(x, y1, x, y2);
lh = legend('y1', 'y2');

legtools.remove(lh, 2);

Throws the following error:

Undefined function or variable 'objtodelete'.

Error in legtools.remove (line 137)
                delete(objtodelete);

Error in testcode (line 9)
legtools.remove(lh, 2);

objtodelete is used by legtools.remove when searching for dummy lineseries objects generated by legtools.adddummy. In the case where no objects are present, this variable is never defined, so attempting to delete it will throw an error.

See: #7

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions