Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Number of ticks for dates still gives overlapping labels #7712

Closed
Milestone
@jorisvandenbossche

Description

@jorisvandenbossche

Matplotlib 2.0 introduced better default tick locators to have a better (often less) number of ticks (http://matplotlib.org/devdocs/users/dflt_style_changes.html#number-of-ticks) that prevents overlap of ticklabels. Which is a really nice enhancement, only it seems that this enhancement is not working for datetime tick labels:

>>> import matplotlib>>> import matplotlib.pyplot as plt>>> matplotlib.__version__'2.0.0rc2'>>> import datetime>>> dates = [datetime.datetime(2016,1,i) for i in range(1,30)]>>> values = list(range(1,30))>>> plt.plot(dates, values)[<matplotlib.lines.Line2D object at 0x7f41327d2e80>]>>> plt.show()

figure_1-2

This still gives the 'too much' tick labels like before (actually, the same plot but with integer x values gives fewer ticks).

Is there a technical reason for this? (theDateLocator using another mechanism to determine the number of ticks as the defaultAutoLocator)

Matplotlib 2.0.0rc2 (installed from conda-forge)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp