Commit
·
050a1a6
1
Parent(s):
81a0426
Adding step_size to the plot
Browse files
app.py
CHANGED
@@ -58,7 +58,7 @@ def generate_random_walk(iters, step_size = 1):
|
|
58 |
info_text = 'Start point=' + str(start_point) + '\n' +'End point=' + str([x[-1],y[-1]]) + '\n' +'Displacement =' + str(distance_from_start([x[-1], y[-1]], start_point)) + '\n' +'Max x = ' + str(max(x)) + '\n' + 'Min x = ' + str(min(x)) + '\n' + 'Max y = ' + str(max(y)) + '\n' + 'Min y = ' + str(min(y))
|
59 |
ax.legend([info_text], loc='best', handlelength=0, handletextpad=0, fancybox=True, fontsize=8)
|
60 |
|
61 |
-
plt.title('2D Random Walk,
|
62 |
plt.grid()
|
63 |
|
64 |
fig.canvas.draw()
|
|
|
58 |
info_text = 'Start point=' + str(start_point) + '\n' +'End point=' + str([x[-1],y[-1]]) + '\n' +'Displacement =' + str(distance_from_start([x[-1], y[-1]], start_point)) + '\n' +'Max x = ' + str(max(x)) + '\n' + 'Min x = ' + str(min(x)) + '\n' + 'Max y = ' + str(max(y)) + '\n' + 'Min y = ' + str(min(y))
|
59 |
ax.legend([info_text], loc='best', handlelength=0, handletextpad=0, fancybox=True, fontsize=8)
|
60 |
|
61 |
+
plt.title('2D Random Walk, steps = ' + str(iters)+', step size = '+ str(step_size))
|
62 |
plt.grid()
|
63 |
|
64 |
fig.canvas.draw()
|