Remove strokes (minorticks?) from xticks/yticks


I am creating a figure with multiple subplots. How can I remove the little strokes at each xtick and ytick?
I thought they were minorticks, so I used ax.minorticks_off() to delete them. However, it did not change the figure output.

Code for Reproduction:

%matplotlib inline
import matplotlib.pyplot as plt

plt.rcParams["font.size"] =  5
plt.rcParams["axes.spines.right"] = False
plt.rcParams["axes.spines.left"] = False
plt.rcParams[""] = False
plt.rcParams["axes.spines.bottom"] = False

X = [x for x in range(2003, 2021)]
Y = [y for y in range(20, 38)]

cols = 2
rows = 2

fig, ax = plt.subplots(
    ncols=cols, nrows=rows, sharey=True, sharex=True

for col in range(cols):
    for row in range(rows):
        ax[col][row].bar(X, Y, color="gainsboro")



Thank you very much for your help!

Assuming you still want the tick labels, the tick length can be set to zero: matplotlib.axes.Axes.tick_params — Matplotlib 3.4.1 documentation

Thank you very much! That worked perfectly.

However, I am still wondering why matplotlib never displayed these little strokes before and it just suddenly changed. Are there new defaults? I can’t really figure out why matplotlib behaves differently without me changing anything.

Nevertheless, thank you!

It’s hard to know without knowing what you mean by “before”. I think in the distant past matplotlib defaulted to ticks pointing inwards?