Skip to content

pad=0 leaves space between label and tick #20677

Open
@nschloe

Description

@nschloe

I would like to place the tick labels snug with the ticks. Setting pad=0 is not enough: There is still a distance between the label and the tick. This is with matplotlib 3.4.2. MWE:

import matplotlib.pyplot as plt
import numpy as np


x = np.array([0.0, 1.0])
y = x
plt.plot(x, y)

ax = plt.gca()
ax.tick_params(axis='both', which='major', pad=0, length=10, width=20)
plt.show()

s3

s1

s2

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