### Using python to plot any graph 14 July 2022
import matplotlib.pyplot as plt
#put here all x axis values
x = [1,2,3,4,5,6,7,8,9,10]
# put here all corresponding y axis values
y = [1,4,9,16,25,36,49,64,81,100]
# plotting the points
plt.plot(x, y, color='green', linestyle='dashed', linewidth = 3,
marker='o', markerfacecolor='blue', markersize=12)
# setting x and y axis range
plt.ylim(1,100)
plt.xlim(1,10)
# naming the x axis
plt.xlabel('x - axis')
# naming the y axis
plt.ylabel('y - axis')
# giving a title to my graph
plt.title('y = ax^2')
# function to show the plot
plt.show()
#using python to plot two lines
import matplotlib.pyplot as plt
# line 1 points
x1 = [1,2,3,4]
y1 = [1,4,9,16]
# plotting the line 1 points
plt.plot(x1, y1, label = "line 1")
# line 2 points
x2 = [1,2,3,4]
y2 = [2,1,5,8]
# plotting the line 2 points
plt.plot(x2, y2, label = "line 2")
# naming the x axis
plt.xlabel('x - axis')
# naming the y axis
plt.ylabel('y - axis')
# giving a title to my graph
plt.title('plotting two lines on same graph!')
# show a legend on the plot
plt.legend()
# function to show the plot
plt.show()
## PYTHON CODE EDITOR
##https://www.w3resource.com/graphics/matplotlib/basic/matplotlib-basic-exercise-5.php
import matplotlib.pyplot as plt
# line 1 points
x1 = [10,20,30]
y1 = [20,40,10]
# plotting the line 1 points
plt.plot(x1, y1, label = "line 1")
# line 2 points
x2 = [10,20,30]
y2 = [40,10,30]
# plotting the line 2 points
plt.plot(x2, y2, label = "line 2")
plt.xlabel('x - axis')
# Set the y axis label of the current axis.
plt.ylabel('y - axis')
# Set a title of the current axes.
plt.title('Two or more lines on same plot with suitable legends ')
# show a legend on the plot
plt.legend()
# Display a figure.
plt.show()