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

First item not displayed with FixedFormatter #7122

Closed
Milestone
@rougier

Description

Tested on matplotib 1.5.1 on OSX, pip installation. Not sure about regression but I never noticed this behavior before.

Expected behavior:

plt.figure(figsize=(6, 4))
ax = plt.subplot(1, 1, 1)
ax.set_xlim(0, 2)
plt.show()

output-1

Bad: Extends the x limit for unknown reason

majors = ["0", "1", "2"]
plt.figure(figsize=(6, 4))
ax = plt.subplot(1, 1, 1)
ax.xaxis.set_major_formatter(ticker.FixedFormatter(majors))
ax.set_xlim(0, 2)
plt.show()

output-2

Bad: First item is not displayed

majors = ["0", "1", "2"]
plt.figure(figsize=(6, 4))
ax = plt.subplot(1, 1, 1)
ax.xaxis.set_major_locator(ticker.MultipleLocator(1.0))
ax.xaxis.set_major_formatter(ticker.FixedFormatter(majors))
ax.set_xlim(0, 2)
plt.show()

output-3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      AltStyle によって変換されたページ (->オリジナル) /