Commit 2fd8362
committed
Don't warn when legend() finds no labels.
There's no warning when calling `plot([])`, so I don't see why there should be
one when calling `legend()` with no labeled artists either (except for catching
basic bugs where someone forgets to pass `label=...`, but such errors are
pretty obvious visually anyways and the warning doesn't help when only *some*
labels are missing).
Typical use case: making a complicated plot with a lot of elements which each
may or may not have a label; now I need to separately keep track of whether I
actually *did* add a label before deciding whether to call `legend()` at the
end.1 parent b65be40 commit 2fd8362
2 files changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
531 | 531 | | |
532 | 532 | | |
533 | 533 | | |
534 | | - | |
535 | | - | |
536 | 534 | | |
537 | 535 | | |
538 | 536 | | |
| |||
0 commit comments