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

log_viewer doesn't work as expected in Jupyter notebook #4

Open
thoth291 opened this issue May 21, 2019 · 4 comments
Open

log_viewer doesn't work as expected in Jupyter notebook #4

thoth291 opened this issue May 21, 2019 · 4 comments

Comments

@thoth291
Copy link

thoth291 commented May 21, 2019

Here is the versions of pandas, numpy and matplotlib I'm using.

numpy                     1.16.3           py37he5ce36f_0    conda-forge
matplotlib                3.1.0                    py37_0    conda-forge
matplotlib-base           3.1.0            py37h5f35d83_0    conda-forge
pandas                    0.24.2           py37hf484d3e_0    conda-forge
petropy                   0.1.6                    pypi_0    pypi

And here is what I'm getting:
image

Any help would be greatly appreciated.

@thoth291 thoth291 changed the title lgo_viewer doesn't work as expected in Jupyter notebook log_viewer doesn't work as expected in Jupyter notebook May 21, 2019
@toddheitmann
Copy link
Owner

The LogViewer is working somewhat correctly. When initialized without providing the top of the viewer, it will show the top of the log. For the example log, the data is mainly null at the top. Specify a depth when intializing with top = 6900 to have the beginning of the viewer start at 6900 FT. The screenshot below is the code reproduced in cell 1. Cell 2 provides the top of the viewer to see data at the beginning of Wolcamp A.

viewer_with_top = ptr.LogViewer(log, top = 6900)

Graphs

Please try this and see how the graph responds. There also appears to be something going on with the depth axis as it is not inverted as it should be.

@thoth291
Copy link
Author

@toddheitmann - thank you - this is really helping! Don't know how I missed that parameter. I also don't know why my depths are off - I tried to get latest commit in the master branch - still the same issues with depth. What versions of matplotlib do you use? How can I replicate your experience?
P.S. I use Linux to run your code - don't know if that matters.

@toddheitmann
Copy link
Owner

I have mainly used Windows and macOS to run this, so thank you for the update and using it on linux. Line 781 is where I invert the y-axis for the plot. Maybe try this code:

import petropy as ptr
log = ptr.log_data('WFMP')
viewer = ptr.LogViewer(log, top = 6900)
ax_zero = viewer.axes[0]
ax_zero.invert_yaxis()
viewer.show()

The LogViewer class keeps the log, matplotlib figure, and matplotlib axes as attributes to customize the appearance after the main graph is created. See this example where a logo is added to the upper left and log information is added to the upper right.

@thoth291
Copy link
Author

Yep - it did the trick. I wonder why it's an issue in Linux. Here is how I changed the code in my private version of it - to make it work. Don't know if I need it to be done for all axis and if this way of doing it has any drawbacks - but it works:

#plt.gca().invert_yaxis()
for ax in self.axes:
    ax.invert_yaxis()

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