set y axis values matplotlib code example

Example 1: set axis title matplotlib

fig.suptitle('test title', fontsize=20)
plt.xlabel('xlabel', fontsize=18)
plt.ylabel('ylabel', fontsize=16)

Example 2: plot bounds python

plt.xlim([25, 50])

Example 3: set axis plt python

from matplotlib import pyplot as plt
plt.axis([0, 10, 0, 20])

Example 4: changing axis labels matplotlib

import matplotlib.pyplot as plt

fig, ax = plt.subplots()

labels = [item.get_text() for item in ax.get_xticklabels()]
labels[1] = 'Testing'

ax.set_xticklabels(labels)

Example 5: how to select axis value in python

plt.xticks(np.arange(x.min(), x.max(), 2))