Closed
Description
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:
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:
Matplotlib version
- Operating system: Windows 10
- Matplotlib version: 3.0.2
- Python version:3.7.2
Matplotlib installed from pip.