Skip to content

Inconsistent argument handling for plot_date() #17548

Closed
@grap3-fru1t

Description

@grap3-fru1t

Pyplot doesn't use a lineplot by default

Pyplot is using a scatterplot by default when no arguments are applied.

import pandas as pd
import matplotlib.pyplot as plt

d = {'dates': ["2019-05-16", "2019-05-19", "2019-05-23"], 'value': [8281, 8193, 7998]}

df = pd.DataFrame(data=d)

x_value = df['dates']
y_value = df['value']

plt.plot_date(x_value, y_value)
plt.gcf().autofmt_xdate()
plt.show()

The code above produces the following output:
grafik

Scatterplot changes to lineplot when color changes
When changing one of the arguments, e.g. the color, the scatterplot changes to lineplot automatically.
When using plt.plot_date(x_value, y_value, 'r') instead, the output produces a lineplot, although the line style '-' was not used as an argument:
grafik

Matplotlib version

  • Operating system: Windows 10
  • Matplotlib version: 3.0.2
  • Python version:3.7.2

Matplotlib installed from pip.

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