Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Number System and Arithmetic
  • Algebra
  • Set Theory
  • Probability
  • Statistics
  • Geometry
  • Calculus
  • Logarithms
  • Mensuration
  • Matrices
  • Trigonometry
  • Mathematics
Open In App
Next Article:
Line Graph
Next article icon

Line Graph

Last Updated : 13 Dec, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

Line graph also known as a line chart or line plot is a tool used for data visualization . It is a type of graph that represents the data in a pictorial form which makes the raw data more easily understandable. In a line graph data points are connected with a straight-line and data points are represented either with points or wedges. Some other examples of graphs are bar graphs, histograms, pie charts, line graphs, etc.

A line graph or line chart is a graphical representation of the data that displays the relationship between two or more variables concerning time. It is made by connecting data points with straight-line segments.

Image showing Parts of Line Graph
Line Graph

Parts of Line Graph

Parts of the line graph include the following:

  • Title: It is nothing but the title of the graph drawn.
  • Axes: The line graph contains two axes i.e. X-axis and Y-axis.
  • Labels: The name given to the x-axis and y-axis.
  • Line: It is the line segment that is used to connect two or more data points.
  • Point: It is nothing but a point given at each segment.

Learn more about Point, Lines, and Plane.

How to Draw and Read a Line Graph?

Drawing a line Graph

To make a line graph we need to use the following steps:

  1. Determine the variables: The first and foremost step is to identify the variables you want to plot on the X-axis and Y-axis.
  2. Choose appropriate scales: Based on your data, determine the appropriate scale.
  3. Plot the points: Plot the individual data points on the graph according to the given data.
  4. Connect the points: After plotting the points, you have to connect those points with a line.
  5. Label the axes: Add labels to the X-axis and Y-axis. You can also include the unit of measurement.
  6. Add Title: After completing the graph you should provide a suitable title.

Reading a Line Graph

To read a line graph you need to follow the below given steps:

  1. Understand the axes: First, you need to understand the X-axis and Y-axis of the graph.
  2. Estimate the scale: Look at the values marked along each axis to determine the scale.
  3. Estimate the values of data points: Look at the data points on the graph to estimate the values on the graph.
  4. Analyze the pattern: Identify the pattern and analyze it.
  5. Conclude: Based on the above step find conclusions.

Example: Draw a line graph for the given data

No. of Days1234
Absentees5101510

Answer:

Example of Line Graph
Line Graph between Days and No. of Absentees

The above diagram shows a line graph between No. of days and the number of absentees.

Types of Line Graph

Let us discuss the types of line graphs:

  • Simple Line Graph
  • Multiple Line Graph
  • Compound Line Graph

Simple Line Graph

It is the most common type of line graph in which a single line represents the relationship between two variables over time. The above diagram is an example of a basic line graph.

Multiple Line Graph

It is the type of line graph in which we can represent two or more lines in a single graph and they can either belong to the same categories or different which makes it easy to make comparisons between them. Multiple line graphs also include a double line graph or we can say that a double line graph is also a multiple line graph.

An example of multiple graphs is shown below:

Multiple Line Graph
Line Graph between Quantity and Year

In the above graph sale of product A and B is shown in the same graph.

Compound Line Graph

It is a type of line graph in which multiple lines or data are combined into a single graph showing different categories or variables. The main aim of a compound line graph is to represent or display the relationship between different variables on a single graph.

A Compound Line graph example is shown below:

Compound Line Graph
Line Graph between Time and No. Of Vehicles

Advantages of Line Graph

Some of the advantages of using line graph are listed below:

  • It helps to visualize the data.
  • It provides a clear overview of the data.
  • It becomes easy to make predictions using a line graph.
  • It helps to compare the data more easily.

Note: Line graph is not suitable to show non linear relationship or complex data

Articles related to Line Graph:

  • Statistics
  • Bar Graphs
  • Histograms
  • Pie Chart

Solved Examples on Line Graph

Examples 1: Draw a line graph for the given data.

Time6 AM10 AM2 PM6 PM
Temperature (in oC)35455040

Solution:

Temperature vs time Line Graph
Line Graph: Temperature vs Time


Examples 2: Draw a line graph from the given data and answer the following questions.

Product A15012510050
Product B12515050100

(a) In the above graph find in which year the sale of product A is maximum.

(b) Find in which year the sale of product B is the minimum.

(c) Find in which year the sale of products A and B is the same.

Solution:

Line Graph showing sale of Product A and B over the years
Line Graph for Sale of Product A and B over the years

(a) In 2011, the sale of product A is maximum.

(b) In 2013, the sale of Product B is minimum.

(c) There is no year in which the sale of Product A and B is the same.

Examples 3: Draw a compound line graph for the given data.

 SamsungAppleOne PlusVivo
Quarter 1712917
Quarter 232212025
Quarter 352606570

Solution:

Line Graph showing Sale of Mobile Phones over each Quarter
Line Graph representing number of Mobile Phones sold in each Quarters

Examples 4: Draw a line graph for the given data

Distance20303545
Time5101520

Solution:

Distance vs Time Line Graph

Examples 5: Draw a line graph for the given data.

Input12457
Output25111420

Solution:

Line Graph Examples 05

Next Article
Line Graph
author
25602umesh2020
Improve
Article Tags :
  • Mathematics
  • School Learning
  • Class 7
  • Geometry
  • Maths-Class-7

Similar Reads

    Horizontal Line
    Horizontal lines are defined as lines that are parallel to the horizon or the ground, hence the name horizontal line. Horizontal line has zero slope, i.e. the inclination angle of these lines is zero degrees. If the horizontal lines are drawn on the Cartesian planes they only make intercept along th
    11 min read
    Family of Lines
    Family simply means a collection of individuals that share common properties among them. Similarly, a family of lines is a collection of lines that share some common properties among them. These lines are related to each other via some specific characteristics, such as being parallel, perpendicular,
    7 min read
    Line Attributes in Computer Graphics
    Computer Graphics is an important topic in the Computer Science domain. It is a type of coding practice that will print the necessary output images. One should have a good imagination to master Computer Graphics. Computer Graphics mainly can be written in C programming language or C++ programming la
    8 min read
    How to Use a Number Line
    Number line is a fundamental concept in mathematics that serves as the visual representation of the numbers and their relationships. It is crucial for understanding basic arithmetic, comparing values, and solving the equations. In this article, we will explore the essentials of the number lines incl
    5 min read
    Line of Best Fit
    Line of Best Fit: A Line of best fit is a fundamental concept of statistics used to analyze the relationship between two variables. It helps predict the values of one variable based on the values of another variable(given). Line of best fit is a straight line drawn through a scatter plot of data poi
    11 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences