Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Set axis ticks matplotlib

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker

x = [0,5,9,10,15]
y = [0,1,2,3,4]
fig, ax = plt.subplots()
ax.plot(x,y)
start, end = ax.get_xlim()
ax.set_xticks(np.arange(start, end, 2))
plt.show()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Set #axis #ticks #matplotlib
ADD COMMENT
Topic
Name
1+8 =