[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Erroroccur: NameError: name 'ax' is not defined

From: Jean-Noël Grad
Subject: Re: Erroroccur: NameError: name 'ax' is not defined
Date: Sat, 26 Sep 2020 17:40:06 +0200
User-agent: Roundcube Webmail/1.3.15

Dear Chandra,

From my side, the following commands produced plots and videos without raising a name error:

make tutorial_11_1_python
mpiexec -n 4 ./pypresso doc/tutorials/11-ferrofluid/

Same observation when exporting the notebook to a python file from the Jupyter client. Could it be possible that the instruction "fig, ax = plt.subplots(figsize=(10,10))" at line 159 was accidentally deleted, or indented it such that it becomes part of the function "run()" declared above?

Best regards,
Jean-Noël Grad

On 9/26/20 6:51 AM, chandra shekhar maurya wrote:
Dear all,
When i am running 11-ferrofluid-part1 by saving a python file in my system using mpirun -np 4 pypresso an error is coming.
Error is                                                                 
   quilibration done
Traceback (most recent call last):
  File "", line 160, in <module>
    part, = ax.plot([],[], 'o')
NameError: name 'ax' is not defined

The code is
   fig, ax = plt.subplots(figsize=(10,10))
part, = ax.plot([],[], 'o')

animation.FuncAnimation(fig, run, frames=loops, blit=True, interval=0, repeat=False, init_func=init)

Thanks & Regards
Chandra Shekhar Maurya
Mechanical Eng. Dept.
Indian Institute of Technology Patna
Contact No:9793572837

reply via email to

[Prev in Thread] Current Thread [Next in Thread]