FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

FIX: stop deprecation message colorbar by jklymak · Pull Request #18860 · matplotlib/matplotlib · GitHub

Repository navigation

FIX: stop deprecation message colorbar - #18860

Merged
QuLogic merged 1 commit into
matplotlib:masterfrom
jklymak:fix-colorbar-solid
Nov 3, 2020
Merged

QuLogic merged 1 commit into
matplotlib:masterfrom
jklymak:fix-colorbar-solid

Conversation

jklymak commented Nov 1, 2020

Copy link
Copy Markdown
Member

PR Summary

Closes #18595

This preserves the existing behaviour without a deprecation warning. The existing behaviour is highly questionable, but...

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

jklymak added this to the v3.3.3 milestone Nov 1, 2020

jklymak commented Nov 1, 2020

Copy link
Copy Markdown
Member Author

I guess this needs a test....

jklymak marked this pull request as draft November 1, 2020 17:10

jklymak commented Nov 1, 2020

Copy link
Copy Markdown
Member Author

OK, So I'm not sure about this. This is only triggered by

import numpy as np
import matplotlib.pyplot as plt

x = np.arange(10.0)
np.random.seed(1024)
mat = np.random.randn(10, 10)
plt.contour(x, x, mat)

# for a solid colorbar:
cbar = plt.colorbar(location='bottom')
cbar.filled = True
cbar.draw_all()
plt.show()

Note that setting filled=True above turns the colorbar solid. However, this is pretty non-standard API, and a pretty strange way to display contours. The user has to manually call draw_all to get this to even happen at all.

So I'll suggest this should be merged to cover this strange edge case, but I'm not particularly convinced we want to protect this behaviour with a test.

jklymak marked this pull request as ready for review November 1, 2020 21:57

QuLogic commented Nov 3, 2020

Copy link
Copy Markdown
Member

If you do plt.colorbar(filler=True) instead, you get:

issue18595.py:12: MatplotlibDeprecationWarning: The 'filled' parameter to Colorbar has no effect because it is overridden by the mappable; it is deprecated since 3.3 and will be removed two minor releases later.
  cbar = plt.colorbar(filled=True)

so I'm convinced that filled probably should have been deprecated as an accessible attribute.

QuLogic merged commit d17905c into matplotlib:master Nov 3, 2020

lumberbot-app Bot commented Nov 3, 2020

Copy link
Copy Markdown

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
$ git checkout v3.3.x
$ git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
$ git cherry-pick -m1 d17905cf70600ef3a0123bc869bd9e06b54017de
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
$ git commit -am 'Backport PR #18860: FIX: stop deprecation message colorbar'
  1. Push to a named branch :
git push YOURFORK v3.3.x:auto-backport-of-pr-18860-on-v3.3.x
  1. Create a PR against branch v3.3.x, I would have named this PR:

"Backport PR #18860 on branch v3.3.x"

And apply the correct labels and milestones.

Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon!

If these instruction are inaccurate, feel free to suggest an improvement.

jklymak deleted the fix-colorbar-solid branch November 3, 2020 21:32
jklymak mentioned this pull request Nov 3, 2020
7 tasks
QuLogic added a commit that referenced this pull request Nov 4, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Getting internal "MatplotlibDeprecationWarning: shading='flat' ..."

3 participants


Back | FazBrowse Home | New Git URL