Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

matplotlib increase tick frequency

# credit ot the Stack Overflow user in the source link
# this is just an example in which you increase the number of ticks on the x-axis
# that is, the spacing between consecutive plotted ticks is reduced 

import numpy as np
import matplotlib.pyplot as plt

x = [0,5,9,10,15]
y = [0,1,2,3,4]

plt.plot(x,y)
plt.xticks(np.arange(min(x), max(x)+1, 1.0))
plt.show()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #matplotlib #increase #tick #frequency
ADD COMMENT
Topic
Name
2+8 =