Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- from matplotlib import pyplot as plt
- import math
- # This simple example still requires X points in an ndarray, old-style:
- x = np.arange(0, 10, .1)
- # but for y data, we can use the class in the snippet above:
- # replace math.sin for any function you want.
- # Not that a scalar function is used, not one that operates on ndarrays (so, not np.sin)
- y = YRenderer(x, math.sin)
- plt(x, y)
- plt.plot(x, y)
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement