# -*- coding: utf-8 -*-
"""
Created on Mon Aug  1 14:01:34 2022

@author: Chris

Lab 1 Question 5
"""

import numpy as np
import matplotlib.pyplot as plt

#Q4a
x = np.linspace(-2,2,100)
f = x**2
plt.plot(x,f)
plt.xlabel('x')
plt.ylabel('f')

plt.show()  #plot the current figure
input()     #pause
plt.figure() #creates a new figure

#Q4b
x = np.linspace(-10,10,100)
f = np.sin(2*x)/x
plt.plot(x,f)
plt.xlabel('x') #label axes
plt.ylabel('f')

plt.show()  #plot the current figure
input()     #pause
plt.figure() #creates a new figure

#Q4c
x = np.linspace(0,3,100)
f = np.exp(2*x)
plt.plot(x,f)
plt.xlabel('x')
plt.ylabel('f')

plt.show()  #plot the current figure
input()     #pause
plt.figure() #creates a new figure

#Q4d
x = np.linspace(0,4,100)
f = 4**(2*x)
plt.plot(x,f)
plt.xlabel('x')
plt.ylabel('f')

plt.show()  #plot the current figure





