8000 matplotlib, date plotting create un-even spaced grid · Issue #15352 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
matplotlib, date plotting create un-even spaced grid #15352
Closed
@sandrotosi

Description

@sandrotosi

Hello,
this image:
py2removal_progress

create from this code:

    # generate a progress graph
    d = defaultdict(int)
    for bug in bugs:
        # there are very old bugs (Jan 2018) tagged `py2removal`; they are just a handful, so let's ignore them
        if bug.done and bug.log_modified.date() >= datetime.date(2019, 7, 1):
            d[bug.log_modified.date()] += 1
    kdates, vbugs = [], []
    total = len(bugs)
    for kdate in sorted(d):
        kdates.append(kdate)
        total = total - d[kdate]  # we remove the amount of bugs closed that day from the total (whole bugs)
        vbugs.append(total)
    plt.plot(kdates, vbugs)
    plt.xticks(rotation=18, ha='right')
    plt.grid()

creates an un-even grid; it would be much more appealing if we can get an evenly spaced grid

BTW this is with mpl/3.0.2

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

      0