Skip to content

scatter and date auto-lim far too wide.... #13639

Closed
@jklymak

Description

@jklymak

Bug report

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt

df = pd.DataFrame({'Depth': [0.2, 0.4, 0.4, 0.4, 0.4, 0.4, 0.6, 0.4, 3.2, 2.0],
                   'DateTimeUTC': [pd.Timestamp('2018-03-28 06:25:08'),
                                   pd.Timestamp('2018-03-28 06:25:49'),
                                   pd.Timestamp('2018-03-28 06:27:06'),
                                   pd.Timestamp('2018-03-28 06:32:11'),
                                   pd.Timestamp('2018-03-28 06:32:59'),
                                   pd.Timestamp('2018-03-28 06:34:02'),
                                   pd.Timestamp('2018-03-28 06:35:38'),
                                   pd.Timestamp('2018-03-28 06:37:04'),
                                   pd.Timestamp('2018-03-28 06:39:08'),
                                   pd.Timestamp('2018-03-28 06:40:52')]})

x = np.asarray(df['DateTimeUTC'])
y = np.asarray(df['Depth'])

fig, axs = plt.subplots(2, 1)


ax = axs[0]
ax.scatter(x, y)
ax.set_title("using scatter")

ax = axs[1]
ax.plot(x, y)
ax.set_title("Using plot")

fig.tight_layout()
plt.show()

Figure_1

Matplotlib version

  • Matplotlib version: master

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