Get Rid of Tick Labels for all subplots

You have the right method. Maybe you are not applying the set_xticks to the correct axes.

An example:

import matplotlib.pyplot as plt
import numpy as np

ncols = 5
nrows = 3

# create the plots
fig = plt.figure()
axes = [ fig.add_subplot(nrows, ncols, r * ncols + c) for r in range(0, nrows) for c in range(0, ncols) ]

# add some data
for ax in axes:
    ax.plot(np.random.random(10), np.random.random(10), '.')

# remove the x and y ticks
for ax in axes:
    ax.set_xticks([])
    ax.set_yticks([])

This gives:

enter image description here

Note that each axis instance is stored in a list (axes) and then they can be easily manipulated. As usual, there are several ways of doing this, this is just an example.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)