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

Skip to content

Commit babf932

Browse files
author
Phil Elson
committed
Moved some variable definitions inside the if statement.
1 parent 835a408 commit babf932

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/matplotlib/contour.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -851,10 +851,11 @@ def legend_elements(self, variable_name='x', str_format=str):
851851
"""
852852
artists = []
853853
labels = []
854-
lowers, uppers = self._get_lowers_and_uppers()
855-
n_levels = len(self.collections)
856-
854+
857855
if self.filled:
856+
lowers, uppers = self._get_lowers_and_uppers()
857+
n_levels = len(self.collections)
858+
858859
for i, (collection, lower, upper) in enumerate(zip(self.collections,
859860
lowers, uppers)):
860861
patch = mpatches.Rectangle((0, 0), 1, 1,

0 commit comments

Comments
 (0)