8000 Make Deprecation Warning in matplotlib more useful · Issue #13352 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Make Deprecation Warning in matplotlib more useful #13352
Closed
@HDembinski

Description

@HDembinski

Bug report

Sources of deprecation warnings in matplotlib are hard to track down.

Code for reproduction

from matplotlib import pyplot as plt
plt.tick_params(left="False")

Actual outcome

/home/hdembinski/.local/lib/python3.7/site-packages/matplotlib/cbook/__init__.py:424: MatplotlibDeprecationWarning: 
Passing one of 'on', 'true', 'off', 'false' as a boolean is deprecated; use an actual boolean (True/False) instead.
  warn_deprecated("2.2", "Passing one of 'on', 'true', 'off', 'false' as a "

As you can see, there is no indication which line in my client code triggers the warning. If the script is long and not minimal, the origin is difficult to find.

Expected outcome
The deprecation warning should be enhanced with a backtrace of some sort, that allows me to find the call in my script which triggers the warning.

Matplotlib version

  • Matplotlib version: 3.0.2
  • Python version: 3.7.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0