Issue
I have this code which plots curves on x and y axis defined by an array u
titulo = "lambda=0.5 M=200 N=10"
M = 200
N = 10
u = calcula_u_a1(M,N)
for i in range (0, M+1, int(M*0.1)):
# if i == 0 or i == round(0.1*M) or i == round(0.2*M) or i == round(0.3*M) or i == round(0.4*M) or i == round(0.5*M):
plt.plot(u[i], label= "t=" + str(i/M))
plt.legend(loc='best')
plt.title(titulo)
plt.xlabel('Distancia')
plt.ylabel('Temperatura')
plt.show()
What I need to do is divide the x scale, so instead of [0, ..., 10] it would be [0, ..., 1] (divide x scale by N)
Anyway of doing that?
Thanks in advance!
Solution
Actually I solved it another way, i created a linearspace and made it my X axis:
titulo = "lambda=0.5 M=800 N=20"
M = 800
N = 20
X = np.linspace(0, 1, N+1)
u = calcula_u_a1(M,N)
for i in range (0, M+1, int(M*0.1)):
plt.plot(X, u[i], label= "t=" + str(i/M))
plt.legend(loc='best')
plt.title(titulo)
plt.xlabel('Distancia')
plt.ylabel('Temperatura')
plt.show()
Answered By - Ilton Andrew
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.