Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jklymak opened this issue Mar 9, 2019 · 3 comments · Fixed by #13642
Closed

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

jklymak opened this issue Mar 9, 2019 · 3 comments · Fixed by #13642

Comments

@jklymak
Copy link
Member

jklymak commented Mar 9, 2019

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
@jklymak
Copy link
Member Author

jklymak commented Mar 9, 2019

This was found by seaborn: mwaskom/seaborn#1641

@ImportanceOfBeingErnest
Copy link
Member

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

@jklymak
Copy link
Member Author

jklymak commented Mar 9, 2019

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants