Skip to content

Contour hatching #706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 16, 2012
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Moved some variable definitions inside the if statement.
  • Loading branch information
Phil Elson committed Mar 20, 2012
commit babf932a9ae0f22afb3d6f21cb78ceed5823f45d
7 changes: 4 additions & 3 deletions lib/matplotlib/contour.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,10 +851,11 @@ def legend_elements(self, variable_name='x', str_format=str):
"""
artists = []
labels = []
lowers, uppers = self._get_lowers_and_uppers()
n_levels = len(self.collections)


if self.filled:
lowers, uppers = self._get_lowers_and_uppers()
n_levels = len(self.collections)

for i, (collection, lower, upper) in enumerate(zip(self.collections,
lowers, uppers)):
patch = mpatches.Rectangle((0, 0), 1, 1,
Expand Down