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

2d section auto closes #977

Open
oliveSea opened this issue Jan 11, 2025 · 2 comments
Open

2d section auto closes #977

oliveSea opened this issue Jan 11, 2025 · 2 comments

Comments

@oliveSea
Copy link

oliveSea commented Jan 11, 2025

Hi all,
I am having an issue with plotting 2d sections.

Describe the bug
plot_2d does not generate plots as expected.

To Reproduce

  1. Run example https://docs.gempy.org/tutorials/ch1_fundamentals/ch1_3b_cross_sections.html#sphx-glr-tutorials-ch1-fundamentals-ch1-3b-cross-sections-py
  2. plot_2d generates matplotlib figures that hang for a few seconds and then auto-closes. No exception is raised.

Expected behavior
Images plotted as shown in example above.

Desktop (please complete the following information):

  • OS: Win11
  • GemPy Version: 2024.2.0.2

Additional context

  • Installation:
    • conda install numpy matplotlib pandas scipy scikit-learn scikit-image gdal pyvista
    • pip install gempy gempy-viewer
  • pyvista's gpv.plot_3d works fine, simple 2d matplotlib plot works fine as well.

Thanks!

@javoha
Copy link
Member

javoha commented Jan 13, 2025

Hi @oliveSea,
thanks for your question. Could you specify exactly for which plots in the given example this happens. Is it only for the custo cross sections? Do you encounter the same problem with other uses of gpv.plot_2d?
Cheers,
Jan

@oliveSea
Copy link
Author

Hi @javoha,
Thanks for your answer. None of the plot_2d or plot_section_traces commands in the example produced a figure for me.
I guess it has to do with figure.show() in plot_2d. Replacing:

if show is True:
    p.fig.show()
    return p

with:

if show is True:
    plt.show()
    return p

worked for me. Is there a parameter in plot_2d to change the mpl interactive mode?

cheers

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

No branches or pull requests

2 participants