Graphic error and simple list

Asked

Viewed 59 times

0

import matplotlib.pyplot as plt
x=[]
y=[]
z=[]
dados=open('dados1.txt','r')
for line in dados:
    line=line.strip()
    X,Y,Z=line.split()
    x.append(X)
    y.append(Y)
    z.append(Z)
dados.close()
plt.plot(x,y,'o')
plt.plot(x,z,'o')
plt.show()

I made a program that collects data from a txt file and generates a graph, but when generating the y-axis became strange.

Eixo y está estranho

  • 1

    What is the error? What is the desired behavior?

  • 2

    Hello, it is much easier to solve your problem if you tell us what your problem is (I believe it is the sorting of numbers on the y-axis, but make it clear that this is the problem). Besides, since we don’t have your data, it’s hard to reproduce this problem. It would be very nice to have a [mcve] to want to answer reproduce your problem.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.