how to use matplotlib in python 3 code example
Example 1: how to import matplotlib in python
import matplotlib
Example 2: how to use timeit in python 3
import timeit
import_module = "import random"
testcode = '''
def test():
return random.randint(10, 100)
'''
print(timeit.repeat(stmt=testcode, setup=import_module))
Example 3: print in python 2
print ""
print 1+1
Example 4: how to use def in python
def functionName(variable):
//function content
Example 5: Use matplotlib in python
import matplotlib.pyplot as plt
from matplotlib import style
style.use('ggplot')
x = [10, 20, 30, 40, 50]
plt.plot(x)
plt.show()