Skip to main content

Python | Introduction to Matplotlib(Only for knowledge)

 Python | Introduction to Matplotlib) Date:ndsfbdbfhfhdgfdh

Matplotlib is an amazing visualization library in Python for 2D plots of arrays. 

Matplotlib is a multi-platform data visualization library built on NumPy arrays and designed to work with the broader SciPy stack. 


It was introduced by John Hunter in the year 2002.

One of the greatest benefits of visualization is that it allows us visual access to huge amounts of data in easily digestible visuals. 


Matplotlib consists of several plots like line, bar, scatter, histogram etc.

Installation :
Windows, Linux and macOS distributions have matplotlib and most of its dependencies as wheel packages. Run the following command to install matplotlib package :

python -mpip install -U matplotlib

 
Importing matplotlib :

from matplotlib import pyplot as plt
or
import matplotlib.pyplot as plt 

Basic plots in Matplotlib :

Matplotlib comes with a wide variety of plots. Plots helps to understand trends, patterns, and to make correlations. They’re typically instruments for reasoning about quantitative information. Some of the sample plots are covered here.



Line plot :

filter_none

brightness_4

# importing matplotlib module 
from matplotlib import pyplot as plt
  
# x-axis values
x = [5, 2, 9, 4, 7]
  
# Y-axis values
y = [10, 5, 8, 4, 2]
  
# Function to plot
plt.plot(x,y)
  
# function to show the plot
plt.show()

 Output:☺☺☺☺☺






Comments

Post a Comment

Popular posts from this blog

Memory Hierarchy

Memory Hierarchy A memory unit is an essential component in any digital computer since it is needed for storing programs and data. Typically, a memory unit can be classified into two categories: The memory unit that establishes direct communication with the CPU is called  Main Memory . The main memory is often referred to as RAM (Random Access Memory). The memory units that provide backup storage are called  Auxiliary Memory . For instance, magnetic disks and magnetic tapes are the most commonly used auxiliary memories. Apart from the basic classifications of a memory unit, the memory hierarchy consists all of the storage devices available in a computer system ranging from the slow but high-capacity auxiliary memory to relatively faster main memory. The following image illustrates the components in a typical memory hierarchy. Auxiliary Memory Auxiliary memory is known as the lowest-cost, highest-capacity and slowest-access storage in a computer system....

Objective Question of Computer Networking

  1.    Choose the correct meaning of the Greek word ‘tele’ in       context of telecommunication. A.   Near B.   Far C.   Never D.   Always   2.    Find the correct term used for the standards that have       been legislated by an officially recognized body.    A.   De jure B.   De facto C.   User standards D.   Channel standards   3.    Which agency developed standards for physical       connection interfaces and electronic signaling       specifications?      A.    ISO B.    ITU C.    ANSI D.    EIA   4.     Find full form of ANSI. A.    American Network Signal Institute B.    American National Signal Institute C.    American National Stand...

CLASS-11 (Python Programming Language)

  Python Programming Language Python is a high-leve l, general-purpose and a very popular programming language. Python programming language (latest Python 3) is being used in web development, Machine Learning applications, along with all cutting edge technology in Software Industry. Python Programming Language is very well suited for Beginners, also for experienced programmers with other programming languages like C++ and Java. Below are some facts about Python Programming Language: Python is currently the most widely used multi-purpose, high-level programming language. Python allows programming in Object-Oriented and Procedural paradigms. Python programs generally are smaller than other programming languages like Java. Programmers have to type relatively less and indentation requirement of the language, makes them readable all the time. Python language is being used by almost all tech-giant companies like – Google, Amazon, Facebook, Instagram, Dropbox, Uber… etc. The biggest stren...