Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3f0afd5

Browse files
committed
Improve empty collection check in add_collection.
1 parent b25d604 commit 3f0afd5

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

lib/matplotlib/axes.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,9 +1491,8 @@ def add_collection(self, collection, autolim=True):
14911491

14921492
if collection.get_clip_path() is None:
14931493
collection.set_clip_path(self.patch)
1494-
if autolim:
1495-
if collection._paths and len(collection._paths):
1496-
self.update_datalim(collection.get_datalim(self.transData))
1494+
if autolim and collection._paths and len(collection._offsets):
1495+
self.update_datalim(collection.get_datalim(self.transData))
14971496

14981497
collection._remove_method = lambda h: self.collections.remove(h)
14991498
return collection

0 commit comments

Comments
 (0)