13 lines
287 B
Python
Executable File
13 lines
287 B
Python
Executable File
import matplotlib.pyplot as plt
|
|
import matplotlib.ticker as ticker
|
|
|
|
x = [0,5,9,10,15]
|
|
y = [0,1,2,3,4]
|
|
|
|
tick_spacing = 1
|
|
|
|
fig, ax = plt.subplots(1,1)
|
|
ax.plot(x,y)
|
|
ax.set_xticks([0,1,2,5,8,9,10,11,20])
|
|
ax.xaxis.set_major_locator(ticker.MultipleLocator(tick_spacing))
|
|
plt.show() |