Own Labels For Ticks Matplotlib

[Solved] Own Labels For Ticks Matplotlib | C - Code Explorer | yomemimo.com
Question : own labels for ticks matplotlib

Answered by : kiril-klein

ax.set_xticklabels(labels)

Source : | Last Update : Thu, 15 Apr 21

Question : matplotlib axis with tick lables but without tick symbole

Answered by : hotflow

import numpy as np
import matplotlib.pyplot as plt
fig, (ax1, ax2, ax3) = plt.subplots(1, 3, figsize=(11, 3))
data = np.random.random((4, 4))
ax1.imshow(data)
ax1.set(title='Bad', ylabel='$A_y$')
# plt.setp(ax1.get_xticklabels(), visible=False)
# plt.setp(ax1.get_yticklabels(), visible=False)
ax1.tick_params(axis='both', which='both', length=0)
ax2.imshow(data)
ax2.set(title='Somewhat OK', ylabel='$B_y$')
plt.setp(ax2.get_xticklabels(), visible=False)
plt.setp(ax2.get_yticklabels(), visible=False)
# ax2.tick_params(axis='both', which='both', length=0)
ax3.imshow(data)
ax3.set(title='Nice', ylabel='$C_y$')
plt.setp(ax3.get_xticklabels(), visible=False)
plt.setp(ax3.get_yticklabels(), visible=False)
ax3.tick_params(axis='both', which='both', length=0)
plt.show()

Source : https://stackoverflow.com/questions/29988241/python-hide-ticks-but-show-tick-labels | Last Update : Thu, 11 Aug 22

Answers related to own labels for ticks matplotlib

Code Explorer Popular Question For C