Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Pyplot hlines and vlines do not use the 'lines.color' property in rcParams by default #16482

Closed
@maij

Description

@maij

Bug report

Bug summary

hlines and vlines color does not default to lines.color in rcParams. The default argument is 'k' which doesn't work with dark backgrounds.

Code for reproduction

import matplotlib.pyplot as plt
import matplotlib as mpl
plt.style.use('dark_background')

plt.figure()
with mpl.rc_context({'lines.color':'white'}):
   plt.hlines(0.5, 0, 1) # defaults to a black line, which doesn't work with a dark background
   plt.vlines(0.5, 0, 1, colors=None) # This will fall back to `lines.color`

Actual outcome

image

Expected outcome

image

Matplotlib version

  • Operating system: Windows 10
  • Matplotlib version: 3.1.2
  • Matplotlib backend (print(matplotlib.get_backend())): module://ipykernel.pylab.backend_inline
  • Python version: 3.7.4
  • Jupyter version (if applicable):
  • Other libraries:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions