Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in maps module #86

Open
sckott opened this issue Aug 30, 2021 · 1 comment
Open

Bug in maps module #86

sckott opened this issue Aug 30, 2021 · 1 comment

Comments

@sckott
Copy link
Collaborator

sckott commented Aug 30, 2021

A pygbif user emailed me today, and I reproduced the error in the maps module.

from pygbif import maps
out = maps.map(taxonKey = 2435098)
out.plot()

gives the error

In [7]:         out.plot()
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-7-b567a22407c0> in <module>
----> 1 out.plot()

~/github/sckott/pygbif/pygbif/maps/map.py in plot(self)
    216
    217     def plot(self):
--> 218         plt.show(self.img)
    219
    220

/opt/homebrew/lib/python3.9/site-packages/matplotlib/pyplot.py in show(*args, **kwargs)
    376     """
    377     _warn_if_gui_out_of_main_thread()
--> 378     return _backend_mod.show(*args, **kwargs)
    379
    380

TypeError: show() takes 1 positional argument but 2 were given

I changed this line https://github.com/gbif/pygbif/blob/master/pygbif/maps/map.py#L218 to be plt.show() and it then worked. I'm not sure if that's the best way to fix it

@alrichardbollans
Copy link

I had the same issue and resolved it using your suggestion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants