Matplotlib is an amazing visualization library in Python for 2D plots of arrays.
Matplotlib consists of several plots like line, bar, scatter, histogram etc.
To import matplotlib:
from matplotlib import pyplot as plt or import matplotlib.pyplot as plt
Matplotlib comes has a great variety of plots available which are easy to use and help us in understanding the underlying trends of data, patterns, etc better.
Problem : Using the given data plot the following
Note: Save the above shown data in an excel sheet and save it as a CSV file. Copy the location of file, as you will need it to retrieve dataset.
Problem 1] Plot Line Chart depicting the prices of apps.
The code snippet is as follows:
Output:
Problem 2] A Bar Chart depicting the downloads of apps
Program 3] Covert Est Downloads sequence that has each value divided by 1000. Now create a bar chart that plots multiple bars for prices as well as est downloads.
Create a CSV file containing two columns: est and prices. Save it and copy its location.
In the above code snippets, Pandas is imported to read the data to plot it.
Matplotlib.pyplt helps in plotting the desired visualization. Using various in-built functions of pyplt we can map data in form of bar graphs, line
To view all the lessons in chapter 8: http://computertutor.in/class-12-computer-science/chapter-8/
To view entire class 12 computer science study material: http://computertutor.in/resources/
You cannot copy content of this page