Advertisement
Guest User

Untitled

a guest
May 26th, 2019
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. import numpy as np
  2. from matplotlib import pyplot as plt
  3. import math
  4.  
  5. # This simple example still requires X points in an ndarray, old-style:
  6. x = np.arange(0, 10, .1)
  7.  
  8. # but for y data, we can use the class in the snippet above:
  9. # replace math.sin for any function you want.
  10. # Not that a scalar function is used, not one that operates on ndarrays (so, not np.sin)
  11.  
  12. y = YRenderer(x, math.sin)
  13. plt(x, y)
  14. plt.plot(x, y)
  15. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement