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

NameError: name 'plt' is not defined #43

Closed
matthewcuyugan opened this issue Aug 31, 2021 · 4 comments
Closed

NameError: name 'plt' is not defined #43

matthewcuyugan opened this issue Aug 31, 2021 · 4 comments

Comments

@matthewcuyugan
Copy link

matthewcuyugan commented Aug 31, 2021

Hi. How can I fix this error while generating the script? Thanks.

Traceback (most recent call last): File "C:\Users\cuyug\Desktop\TroPYcal codes\prettymaps.py", line 4, in <module> from prettymaps import * File "C:\Users\cuyug\Desktop\TroPYcal codes\prettymaps.py", line 17, in <module> layers = plot( NameError: name 'plot' is not defined

@mei-se
Copy link
Contributor

mei-se commented Aug 31, 2021

You need to import plt, like so

from matplotlib import pyplot as plt

Here you can find a working example:

https://github.com/marceloprates/prettymaps/blob/main/notebooks/examples.ipynb

@matthewcuyugan
Copy link
Author

matthewcuyugan commented Aug 31, 2021

You need to import plt, like so

from matplotlib import pyplot as plt

Here you can find a working example:

https://github.com/marceloprates/prettymaps/blob/main/notebooks/examples.ipynb

I'm still having the same issue.

Here's the intro to the script:

image

Here's the error:

image

@matthewcuyugan
Copy link
Author

matthewcuyugan commented Sep 2, 2021

Found the solution. Thanks!

from prettymaps import plot

@Jannomag
Copy link

@matthewcuyugan can you share your whole script? I'm trying for hours now but I just got the same error as you did.

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