Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib.pyplot as plot
- import numpy
- arr_1 = numpy.arange(0, 10, 1)
- arr_2 = numpy.arange(0, 1000, 10)
- def func_with_cos(x):
- '''
- :param x: rad
- :return:
- '''
- return x ** 2 - numpy.cos(x)
- def func_with_sqrt(x):
- return x ** (1 / 3) - numpy.sqrt(x)
- if __name__ == '__main__':
- plot.figure(1)
- plot.subplot(211)
- plot.plot(arr_1, func_with_cos(arr_1), 'b')
- plot.title('with cos func')
- plot.grid(True)
- plot.subplot(212)
- plot.plot(arr_2, func_with_sqrt(arr_2), 'k--')
- plot.title('with sqrt func')
- plot.grid(True)
- plot.subplots_adjust(top=0.9, bottom=0.08, left=0.10, right=0.95, hspace=0.35,
- wspace=0.35)
- plot.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement