8000 Implement extend color bar for contourf · Pull Request #8806 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Implement extend color bar for contourf #8806

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

Closed
wants to merge 4 commits into from
Closed
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
Update tempLocator in case ticker is not given
  • Loading branch information
Tuan authored Jun 26, 2017
commit 9fa40cc3cda6bca9d57f49d82f5d7c965359dfd8
4 changes: 3 additions & 1 deletion lib/matplotlib/contour.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import matplotlib.texmanager as texmanager
import matplotlib.transforms as mtransforms
from matplotlib.cbook import mplDeprecation
from matplotlib.ticker import Locator
from matplotlib.ticker import Locator, LogLocator

# Import needed for adding manual selection capability to clabel
from matplotlib.blocking_input import BlockingContourLabeler
Expand Down Expand Up @@ -1212,6 +1212,8 @@ def _process_levels(self):
self._levels = list(self.levels)

tempLocator = Locator()
if self.logscale:
tempLocator = LogLocator()
if self.locator is not None:
tempLocator = self.locator
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using a temporary Locator and then requiring that all Locators have 3 new private methods, I think it would be better to keep everything within the ContourBase class. This will be more readable than using Locator private methods that modify one of their arguments. It will likely require fewer LOC as well.

Copy link
Author
@ghost ghost Jun 28, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@efiring Thank you for the input. I took sometimes to think it over more carefully, I will fix it your way.

if self.extend in ('both', 'min'):
Expand Down
0