Skip to content

Instantly share code, notes, and snippets.

@kshitij10496
Created April 26, 2019 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kshitij10496/f3235ba5357753aa5f4ecff087f274b9 to your computer and use it in GitHub Desktop.
Save kshitij10496/f3235ba5357753aa5f4ecff087f274b9 to your computer and use it in GitHub Desktop.
Jena's MTP Code
import numpy as np
import matplotlib.pyplot as plt
def plot(x, y, deg, well):
'''
x, y are the inputs (porosity and permeability) respectively.
deg = degree of the ploynomial best-fit curve.
well = name of the well.
'''
z = np.polyfit(x, y, deg)
plt.rcParams.update({'font.size': 16})
plt.plot(np.unique(x), np.poly1d(z)(np.unique(x)), label='Best Fit Curve')
plt.plot(x, y, '.r', label='Core Permeability Data')
plt.title(well + ': Permeability vs Porosity Relationship')
plt.xlabel('Porosity (Fraction)')
plt.ylabel('Permeability (mD)')
plt.legend()
plt.savefig(well + '.png')
plot(x, y, 3, "Well 1")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment