Skip to content

contour ignores lw argument, no warning/error #13848

@lzkelley

Description

@lzkelley

Bug report

The command contour does not use lw arguments (unlike, e.g., plot), and does not report an error or warning. The linewidths argument works fine. A simple fix is to explicitly look for lw arguments and set linewidths to that. Happy to put in a PR for this, but I wanted to check first.

import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
print(mpl.__version__)

fig, axes = plt.subplots(ncols=3)

for ax, lw, arg in zip(axes, [1.0, 4.0, 4.0], ['lw', 'lw', 'linewidths']):
    aa = np.random.normal(size=1000)
    bb = np.random.normal(size=aa.size)
    hist, xe, ye = np.histogram2d(aa, bb)
    kw = {arg: lw}
    ax.contour(hist, **kw)
    ax.set_title('{}: {}'.format(arg, lw))

plt.show()

Actual outcome

mpl

Matplotlib version

  • Matplotlib version: 3.0.2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy