<jupyter_start><jupyter_text>PlottingSome preliminaries...<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import welly
welly.__version__<jupyter_output><empty_output><jupyter_text>Load a well and add deviation and a striplogUse the `from_las()` method to load a well by passing a filename as a `str`. This is really just a wrapper for `lasio` but instantiates a `Header`, `Curve`s, etc.<jupyter_code>from welly import Well
w = Well.from_las('P-130_out.LAS')
w.data.keys()
w.data['GR'].plot()<jupyter_output><empty_output><jupyter_text>Load a deviation survey.<jupyter_code>dev = np.loadtxt('P-130_deviation_survey.csv', delimiter=',', skiprows=1)
w.location.add_deviation(dev[:, :3], td=2618.3)
w.location.md2tvd(2000)<jupyter_output><empty_output><jupyter_text>Add a striplog.<jupyter_code>from striplog import Legend, Striplog
legend = Legend.builtin('NSDOE')
strip = Striplog.from_image('P-130_25_2618.png', 25, 2618, legend=legend)
strip.plot(aspect=2)
w.data['strip'] = strip<jupyter_output><empty_output><jupyter_text>Basic plotWe want to use a legend so we get the striplog to look right:<jupyter_code>tracks = ['MD', 'strip', 'GR', 'RHOB', ['DT', 'DTS'], 'M2R9', 'MD']
w.plot(tracks=tracks, legend=legend)<jupyter_output><empty_output><jupyter_text>The legend doesn't have entries for the curves, so they are grey. Let's add some.<jupyter_code>curve_legend_csv = """colour,lw,ls,xlim,xscale,curve mnemonic
#ff0000,1.0,-,"0,200",linear,GR
blue,1.0,-,,linear,RHOB
#00ff00,1.0,--,,linear,DT
#ffff00,1.0,--,,linear,DTS
black,1.0,,,log,M2R9
"""
curve_legend = Legend.from_csv(text=curve_legend_csv)
complete_legend = legend + curve_legend
complete_legend[-6:]
curve_legend.get_decor(w.data['GR'])
w.data['GR'].plot(legend=curve_legend)
w.plot(tracks=tracks, legend=complete_legend, extents=(700, 1200))<jupyter_output><empty_output><jupyter_text>2D log plotA variable density display.<jupyter_code>w.data['GR'].plot_2d(cmap='viridis')
w.data['GR'].plot_2d(curve=True,cmap='viridis')<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup