python-hydro/pyro2

Error in terminal when animation is running and you click the animation

jmuzsik opened this issue ยท 0 comments

๐Ÿ‘‹

I noticed that when I run an animation from the terminal, mouseover-it and click it I get an error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/matplotlib/cbook/__init__.py", line 216, in process
    func(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/matplotlib/backend_bases.py", line 2733, in mouse_move
    data_str = a.format_cursor_data(data)
  File "/usr/local/lib/python3.7/site-packages/matplotlib/image.py", line 956, in format_cursor_data
    + "]")
AttributeError: 'Colorbar' object has no attribute 'formatter'

I went through the code and figured out how to fix it:

For example, in /compressible/simulation.py I simply import matplotlib add this to line 285:

cb.formatter = matplotlib.ticker.ScalarFormatter(useMathText=True)

This issue is a primarily to see if you can replicate this error on your side or if it is an isolated instance of my environment (I am using Python 3.7.6 and matplotlib 3.1.2 (I just downloaded it with pip3)).

If so, I can do a quick PR. Also, I had a bit of trouble getting this to run on my macbook so I wouldn't mind adding a few instructions for mac users.