Skip to content

Instantly share code, notes, and snippets.

@tekknolagi
Created March 15, 2018 15:41
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 tekknolagi/ebfd391503ab773dc12fff79f4f96b76 to your computer and use it in GitHub Desktop.
Save tekknolagi/ebfd391503ab773dc12fff79f4f96b76 to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
import numpy as np
from decimal import *
getcontext().prec = 1000
e = Decimal(np.e)
def y1(x):
return np.log10(e**x * x**23)
three = Decimal(3)
def y2(x):
return np.log10(three**x)
if __name__ == '__main__':
f = plt.figure(1)
plt.grid(True)
xs = np.arange(10, 3000, 100,
dtype=np.dtype(Decimal))
plt.plot(xs, y1(xs),
label=r'$log_{10}(e^x * x^{23})$')
plt.plot(xs, y2(xs),
label=r'$log_{10}(3^x)$')
plt.legend()
f.savefig('megan.png', dpi=300)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment