Guest User

Untitled

a guest
Jul 22nd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3.  
  4. def exp2lin(x):
  5. # convert exponential values to linear ones
  6. epsilon = 1 - np.fabs(x).min()
  7. return np.sign(x) * np.log10( epsilon + np.fabs(x) )
  8.  
  9. X = np.linspace(-3,3,1000)
  10. Y = np.concatenate([-np.logspace(3,-0.01,500), np.logspace(-0.01,3,500)])
  11. Y_hat = exp2lin(Y)
  12. #plt.scatter(X, Y, s=1, color="blue")
  13. plt.scatter(X, Y_hat, s=1, color="green")
  14. plt.show()
Add Comment
Please, Sign In to add comment