Search
 
SCRIPT & CODE EXAMPLE
 

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()
Comment

PREVIOUS NEXT
Code Example
Python :: jupyter notebook for pdf generation 
Python :: isolate row based on index pandas 
Python :: measure time per line python 
Python :: python formatting strings 
Python :: how to print answer 2 decimal places in python 3 
Python :: django include all columns admin show 
Python :: Access the Response Methods and Attributes in python Get the HTML of the page 
Python :: redirect in dajango 
Python :: tower of hanoi python 
Python :: google text to speech python 
Python :: when button is clicked tkinter python 
Python :: python round down 
Python :: ordereddict 
Python :: python loop append to dictionary 
Python :: install tensorflow gpu 
Python :: python max key dictionary key getter 
Python :: how to make an infinite loop python 
Python :: pygame window at center 
Python :: python generate public private key pair 
Python :: python all lowercase letters 
Python :: remove last element from list python 
Python :: OneHotEncoder() 
Python :: how to convert the date column from string to a particular format in python 
Python :: rmse python 
Python :: pandas read csv skip rows 
Python :: moving file in python 
Python :: remove ,drop,effacer, dataframe,python 
Python :: how to make a resizable python tkinter window have a limit 
Python :: pandas dataframe add column from another column 
Python :: cd in python 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =