Skip to main content

Posts

Showing posts from May, 2022

Matplotlib Basic Functions

 Learn Some Basic Functions of Matplotlib Importing the packages: import matplotlib.pyplot as plt import numpy as np Plotting the points: x = np. array ([ 20 , 60 ]) y = np. array ([ 30 , 32 ]) print (x) plt. plot (x,y) Scatter Points: #plot 1 x = [ 1 , 2 , 3 , 4 , 5 ] y = [ 2 , 5 , 7 , 8 , 9 ] plt. scatter (x,y) #plot 2 x = [ 1 , 5 , 3 , 8 , 5 ] y = [ 2 , 3 , 7 , 6 , 9 ] plt. scatter (x,y) Bar Function: class1 = [ " a " , " b " , " c " , " d " ] x = [ 3 , 5 , 10 , 8 ] Pie Chart: values = [ 15 , 25 , 30 , 30 ] plt. pie (values)