0% found this document useful (0 votes)
53 views5 pages

Python: - To Start, Input Your Commands Here

The document provides instructions for plotting different types of functions using Jupyter Notebook. It demonstrates how to plot polynomial, exponential, and combined functions by generating x-values, calculating the corresponding y-values using numpy functions, and using matplotlib to plot the x and y points and display the graph. Examples shown include plotting quadratic, cubic, and exponential decay functions with varying numbers of data points.

Uploaded by

ch_ymyaa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views5 pages

Python: - To Start, Input Your Commands Here

The document provides instructions for plotting different types of functions using Jupyter Notebook. It demonstrates how to plot polynomial, exponential, and combined functions by generating x-values, calculating the corresponding y-values using numpy functions, and using matplotlib to plot the x and y points and display the graph. Examples shown include plotting quadratic, cubic, and exponential decay functions with varying numbers of data points.

Uploaded by

ch_ymyaa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Online Python using Jupyter:

https://try.jupyter.org/
Python

Double click this link

• To start, input your


commands here
Plotting polynomial function: y=x 2

Value of x ranges from -6 to 6,


x = np.linspace(-6,6,100) with 100 data points
x**2 means x2 (note: x*2 means 2x)
y = (x**2)
plt.plot(x,y)
x = np.linspace(-6,6,6)
plt.show() y = (x**2)
plt.plot(x,y)
Plot with 100 data points plt.show()
Plot with only 6 data points
Plotting polynomial function:
x = np.linspace(-6,6,100)
y = (x**2-4*x+8) y=x2-4x+8
plt.plot(x,y)
plt.show()
Plotting exponential function:
x
y=e and y=e -x

x = np.linspace(-4,6,100) x = np.linspace(-6,6,100)
y = np.exp(x) y = np.exp(-x)
plt.plot(x,y) plt.plot(x,y)
plt.show() plt.show()
Plotting 2
y=x e-x

x = np.linspace(-1,8,100)
y = (x**2)*np.exp(-x)
plt.plot(x,y)
plt.show()

You might also like