def main():
    rwalk = RandomWalk()
    rwalk.array_size, rwalk.dim_size = RandomArgsParser.read_args(RandomArgsParser, sys.argv, rwalk.array_size, rwalk.dim_size)
    print(rwalk.dim_size)
    rwalk.gen_dwalk()
    if rwalk.dim_size >= 2:
        print_plot(rwalk)
        plt.show()
import numpy as np
import matplotlib.pyplot as plt
from random_walk import RandomWalk
from random_args_parser import RandomArgsParser
from matplotlib.animation import FuncAnimation

#if '-p' in sys.argv:
#import cProfile

anim_count = 0
fig, ax = plt.subplots()
xdata, ydata = [], []
ln, = plt.plot([], [], 'r', animated=True)

rwalk = RandomWalk()
rwalk.array_size = 10000
rwalk.dim_size = 2
rwalk.gen_dwalk()


def init():
    global rwalk
    ax.set_xlim(np.nanmin(rwalk.dim_array[0]), np.nanmax(rwalk.dim_array[0]))
    ax.set_ylim(np.nanmin(rwalk.dim_array[1]), np.nanmax(rwalk.dim_array[1]))
    return ln,


def update(frame):
    global anim_count
    xdata.append(rwalk.dim_array[0][anim_count])
    ydata.append(rwalk.dim_array[1][anim_count])