Skip to content

pyplot.plot casts integer tick values to floats #2796

Closed
@fonnesbeck

Description

@fonnesbeck

When passing integer values to pyplot.plot, they get turned into floats, resulting in incorrect axis labels (at least, for the x-axis). For example, if you pass

x = np.arange(2006, 2012, dtype=np.int64)

as the x-value in plot, the resulting ticks are [0, 1, 2, 3, 4, 5]. I discovered this using Pandas, but was shown that it is a Matplotlib issue. Here is the original report.

pandas-dev/pandas#6272

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions