FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[Bug]: ConciseDateFormatter not showing offset · Issue #21670 · matplotlib/matplotlib · GitHub

Repository navigation

[Bug]: ConciseDateFormatter not showing offset #21670

Closed

Description

Bug summary

When I create time series plot with too big time range, I can't see offset in lower right corner.

Code for reproduction

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

LEN = 40000
dt_index = pd.date_range('2013-01-01 00:00', periods=LEN, freq='5min')
df = pd.DataFrame({'data': np.random.randint(10, size=LEN)},index=dt_index)

fig, ax = plt.subplots()
import matplotlib.dates as mdates

locator = mdates.AutoDateLocator()
formatter = mdates.ConciseDateFormatter(locator)
ax.xaxis.set_major_locator(locator)
ax.xaxis.set_major_formatter(formatter)

ax.plot(df.index, df.data)

plt.show()

Actual outcome

Expected outcome

Additional information

When changing time range with fewer points, I can see the offset as seen in expected outcome.

Operating system

Ubuntu

Matplotlib Version

3.4.3

Matplotlib Backend

Qt5Agg

Python version

3.9

Jupyter version

No response

Installation

No response

Activity

  1. jklymak commented on Nov 18, 2021

    Member

    There is no offset if the year is indicated in the axis somewhere. I think this is expected behaviour.

  2. Stassels commented on Nov 18, 2021

    Author

    There is no offset if the year is indicated in the axis somewhere. I think this is expected behaviour.

    Sorry, I probably didn't wrote it clearly enough.
    When I use pan/zoom tool and zoom in to months/days/day, I still can't see the offset. I think that's not expected behavior.

    But when I use this example and change LEN to 35000 and then use pan/zoom tool and zoom out, I can see the offset in any zoom level.

  3. dstansby commented on Nov 28, 2021

    Member

    Thanks for the self contained example; I can reproduce this bug.

  4. jklymak commented on Nov 28, 2021

    Member

    Thanks both! #21785 should fix this.

  5. added this to the v3.5.1 milestone on Feb 16, 2022
  6. added a commit that references this issue on Nov 23, 2025
    5f10ce8
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL