Skip to content

plt.plot does not plot anything with named arguments #12106

Closed
@taxus13

Description

@taxus13

Bug report

Bug summary

When using named arguments for x and y, the plots created with plt.plot respectively ax.plot are keeping empty. plt.errorbar (or ax.errorbar) are producing the desired output (see code below).
The documentation shows that x and y are valid named arguments.

Code for reproduction

import matplotlib.pyplot as plt
import numpy as np

x = np.arange(0, 12, .5)
y = np.random.rand(*x.shape)
plt.plot(x, y) #  works as expected
plt.plot(x=x, y=y) # shows empty plot
plt.errorbar(x=x, y=y) # works as expected

Actual outcome
empty-diagram

Expected outcome
desired-diagram
or
desired-diagram2

Matplotlib version

  • Operating system: Windows 10x64
  • Matplotlib version: 2.2.3 (had the same issue with 2.2.2)
  • Matplotlib backend (print(matplotlib.get_backend())): 'module://ipykernel.pylab.backend_inline'
  • Python version: 3.6.2
  • Jupyter version (if applicable): 1.0.0 (Jupyter notebook 5.1.0rrc1)
  • Other libraries: numpy 1.14.5+mkl

Python was installed using WinPython, packages installed with pip.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions