Skip to content

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

Closed

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

Activity

  1. jklymak commented on Mar 9, 2019

    @jklymak
    MemberAuthor

    This was found by seaborn: mwaskom/seaborn#1641

  2. ImportanceOfBeingErnest commented on Mar 9, 2019

    @ImportanceOfBeingErnest
    Member

    I think this is still the old issue #7413 which already has quite some duplicates.

  3. jklymak commented on Mar 9, 2019

    @jklymak
    MemberAuthor

    Good catch, absolutely. I'll close this and link in that issue....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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