im trying to create a program that reads a text file and plots the data using matplotlib. however, what i want to do is subdivide the each major y-axis display into 10 smaller segments. ive tried matplotlib.pyplot.yscale but i cant seem to quite get the hang of it. any help is appreciated. below is the code
import matplotlib.pyplot as mpl
import numpy as npy
import os
import sys
import string
def isFloat(string):
try:
float(string)
return True
except ValueError:
return False
fileopen = open ('output.txt' , 'r')
filelist = fileopen.readlines()
angle = []
timeset = []
for onefile in filelist:
if( isFloat(onefile.strip()) == True ):
angle.append (eval (onefile))
for dt in range (0,len(angle)): #create time steps equal to the number of input angles
timeset.append (dt * 1)
mpl.plot (timeset , angle , 'r')
mpl.xlabel ('Time (Seconds)')
mpl.ylabel ('Angle (Degrees)')
mpl.yscale ('linear' , ([range (0,10)]))
mpl.show ()