I Am making a current scientific graph on matplotlib for a worksheet. Making a S-N graph and wanting my x-axis to show 10^5, ect for the amount of 0s there is. i will put my code in and show my graph vs what i actually need. cheers
my code here:
import matplotlib.pyplot as plt
import numpy as np
data = np.loadtxt('data.csv', delimiter =',')
#print(data)
x = []
y = []
for i in range(len(data)):
for j in range(2):
if j ==0:
y.append(data[i][j])
else:
x.append(data[i][j])
print(x)
print(y)
plt.ylim([0,16])
plt.yticks(range(0,16,5))
plt.plot(x, y, label = "Stainless Steel")
plt.xlabel("Number of cycles (N)")
plt.ylabel("Angle of amplitude (S)")
plt.title("S-N Graph")
plt.legend()
plt.grid(True)
plt.show()