I am trying to make a graph with fixed ticks, regardless to the points values. For example, I want the ticks to be 0-6, and the points values to be 0, 1, 3. I'd use this code:
import matplotlib.pyplot as plt
import numpy as np
x_points = np.array([0, 1, 3])
y_points = np.array([0, 1, 3])
x_ticks = np.arange(0, 7, 1)
y_ticks = np.arange(0, 7, 1)
plt.xticks(x_ticks)
plt.yticks(y_ticks)
plt.plot(x_points, y_points)
plt.show()
But the result is only 0, 1, 3 ticks - which are the ticks for the actual current values, and not the values I set using xticks and yticks:
And I would like to have the ticks fixed, regardless to whether the points values are actually represented in the graph or not, something like that:
How can I make the axis' ticks to be fixed, regardless of the values it has?