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

plot not showing when used in .py file #223

Open
gbene opened this issue Dec 1, 2022 · 5 comments
Open

plot not showing when used in .py file #223

gbene opened this issue Dec 1, 2022 · 5 comments
Labels

Comments

@gbene
Copy link

gbene commented Dec 1, 2022

Hi! I was trying out this library and I can't seem to plot the well data when using it in a script (in jupyter notebook works).

By following the documentation both

from welly import Well

well = Well.from_las('./data/A10.las')

perm = well.data['PERM']

perm.plot()

and

from welly import Well

well = Well.from_las('./data/A10.las')

well.plot()

should work.

For me it does not work, the plots do not show up and the script terminates without any errors. Am I doing something wrong?

Thanks!

@kwinkunks
Copy link
Member

Please try instantiating the plot in your script and passing the Axes object to welly to plot into, like:

import matplotlib.pyplot as plt

fig, ax = plt.subplots()
ax = well.plot(ax=ax)
plt.show()

@gbene
Copy link
Author

gbene commented Dec 1, 2022

Yes sorry, I did try that too. It returns an empty plot

image

@kwinkunks
Copy link
Member

Hm, that does seem like a bug. I'm afraid the quickest thing will be to loop over the well.data dictionary and construct the plot yourself one curve at a time.

@kwinkunks kwinkunks added the bug label Dec 1, 2022
@gbene
Copy link
Author

gbene commented Dec 1, 2022

All right, thanks! I am encountering the same problem in the striplog package (e.g. striplog.plot() does nothing). I don't know if this information helps in any way.

Have a nice day!

@rselover
Copy link

rselover commented Dec 1, 2022

I'd have to double-check the use case, but you can run .ipynb's from the command line - see answer #4 in this thread:

https://stackoverflow.com/questions/35545402/how-to-run-an-ipynb-jupyter-notebook-from-terminal

ipython -c "%run your_script.ipynb"

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

No branches or pull requests

3 participants