Page 1 :
For More Updates Visit: www.python4csip.com, , Data Visualization, , , , When data is shown in the form of pictures, it becomes easy, for the user to understand it. So representing the data in the, form of pictures or graph is called “data visualization”. It, represents (patterns, trends, correlations etc.) in data and, thereby helps decision makers to understand the meaning of, , data for making decision in business., , e Matplotlib is a python library which provides many, interfaces and function to present data in 2D graphics., We can say, Matplotlib is a high quality plotting library, of Python., , e Matplotlib library offers many different collections of, sub modules; Pyplot is one such sub module., , e Pyplot is a collection of methods within Matplotlib, , library which allows user to construct 2D plots easily., , Installing and importing Matplotlib, , , With Anaconda: if we have installed python using Anaconda,, then Matplotlib is already installed on your computer. We can, , CREATED BY: SACHIN BHARDWAJ, PGT (CS) KV NO.1 TEZPUR, MR. VINOD, KUMAR VERMA, PGT (CS) KV OEF KANPUR
Page 2 :
For More Updates Visit: www.python4csip.com, , check this Anaconda Navigator, by Clicking on Environment, and then scroll down to find Matplotlib., , With Standard Installation : First we need to download, wheel package of Matplotlib as per Python’s version installed, and platform (OS)., , , , With Standard Installation : Next we need to install it by, giving following command:, , python -m pip install -U pip, python -m pip install -U matplotlib, , To use Pyplot for data visualization, we have to first import, it in our python environment., , import matplotlib.pyplot, , But this method will require to type every command as , CREATED BY: SACHIN BHARDWAJ, PGT (CS) KV NO.1 TEZPUR, MR. VINOD, KUMAR VERMA, PGT (CS) KV OEF KANPUR
Page 3 :
For More Updates Visit: www.python4csip.com, Another methodfisg, import matplotlib.pyplot as plt, (Now we can qualify command as plt.Command), , (plt is just identifier we can take any name), , Basics of Simple Plotting, , , , There are various types of chart we can use to visualize the data elements, like:, , © Line Chart: it displays information as a series of data points called, ‘markers’ connected by straight line, , © Bar Chart: it present category wise data in rectangular bars with length, proportional to the values. It can be horizontal and vertical., , © Pie Chart: is a circular chart divided into slices to represent the, value/percentage., , 8, , , , , , , , Y, \, o” |, | |, Meee, , Mitveterry ME Raschery ME Apple, , , , , , CREATED BY: SACHIN BHARDWAJ, PGT (CS) KV NO.1 TEZPUR, MR. VINOD, KUMAR VERMA, PGT (CS) KV OEF KANPUR
Page 4 :
For More Updates Visit: www.python4csip.com, , Line Chart or Line Graph, , , , Line graph is a simple graph that shows the result in the form, of lines. To create a line graph we need x and y coordinates., , For example, plot() function is used to draw line chart. In previous, examples we already observed this. Let us draw and use, , various attributes available with plot(., , , , 5.0, , #Simple line draw, import matplotlib.pyplot as plt «5, x=(1,2,3], y=[2,3.5,5], plt.plot (x,y), plt.show() 30, , 40, , 35, , 25, , , , , , 20, , , , 100 125 150 175 200 225 250 275 300, , # Setting Label of X and Y axis and also title for chart, import matplotlib.pyplot as plt, , x= [ 10, 20, 30, 40, 50], , y = (65, 98, 170, 220, 310], , plt.xlabel('Overs'), , plt.ylabel('R 5CO!, plt.title('Over wi, plt.plot (x,y), plt.show()