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

Fix plot 2d curve #236

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

NicolasCami
Copy link

Disclaimer: I did my best to explain the following issue and propose a fix. Don't hesitate to challenge this proposal or reject the pull request if not relevant.

Short description of the issue

Curve that contains multiple parts breaks the 2D plot with curve.

How to reproduce

  • Use a LAS file containing a curve with multiple parts (see example below).
  • Load LAS file and display 2D curve:
las_fname = '...'
curve_name = '...'
well = Well.from_las(las_filename)
well.data[curve_name ].plot_2d(curve=True)
plt.show()

Example of problematic curve

Let's say you have a LAS with NULL VALUE = -999, i.e. you can read in the LAS header:
NULL . -999.0000 : NULL VALUE
A problematic curve would be like:

 192.4000
 192.5000
 -999.0000  <--- This NULL value splits the curve in two
 192.4000
 192.5000

Screenshot

image

Proposed fix

In plot_2d_curve only the first path returned by fill_betweenx is considered to build the PathPatch. As a result, the mask only covers the first portion of the curve. The rest is left blank. To fix the issue I just combined every paths into a single PathPatch object.

image

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

Successfully merging this pull request may close these issues.

1 participant