0

In Jupyter I wrote the following:

c357=np.loadtxt('/path/to/file.txt', dtype=str, delimiter=',')  
t357=np.loadtxt('/path/to/file.txt', dtype=str, delimiter=',')  
fig,ax=plt.subplots(figsize=(10,10)).  
ax.scatter(c357,t357)

Plot of what code gives

I have no idea why the axes aren't actually in order and if someone could help that would be great, thanks!

Kraigolas
  • 5,121
  • 3
  • 12
  • 37
John
  • 1
  • 1
  • 1
    Please [edit] the question to include a [mre]. We need access to some sample data to determine what's going wrong. – Kraigolas Aug 01 '22 at 14:42
  • Is your data in some kind of number format (float, int)? – Jacob Aug 01 '22 at 14:43
  • Your data are text, not floats. – BigBen Aug 01 '22 at 14:51
  • @BigBen How could I get the data in floats? When I try to do dtype=float I get the error could not convert string to float: '' – John Aug 01 '22 at 15:32
  • That's your problem? `''` can't be converted to a float. Maybe your data isn't what you think it is. – BigBen Aug 01 '22 at 15:35
  • 1
    @BigBen Yeah you're right haha. There was a comma at the end of the .txt file and that's why it wouldn't allow it to be converted into a float. Thank you! – John Aug 01 '22 at 15:40

0 Answers0