Question: A trend Graph is a graph that is used to show the trends data over a period of time. It describes a functional representation of
A trend Graph is a graph that is used to show the trends data over a period of time.
It describes a functional representation of two variables x y
In which the x is the timedependent variable whereas y is the collected data.
The graph can be in shown any form that can be via line chart, Histograms, scatter plot, bar chart, and piechart.
In python, we can plot these trend graphs by using matplotlib.pyplot library.
It is used for plotting a figure for the given data.
Python Practice
# import all the libraries
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# Create a dataframe
data
"medals":
"TimePeriod":
df pdDataFramedata
printdf
# to plot the graph
dfplotx"TimePeriod", y"medals", kind"line"
pltshow
Python Practice the following is Python code to plot a scatter plot and a bar graph using the provided data:
# Scatter plot
pltfigurefigsize
pltscatterdfTimePeriod' dfmedals color'blue'
plttitleScatter Plot of Medals Over Time Period'
pltxlabelTime Period'
pltylabelMedals
pltgridTrue
pltshow
# Bar graph
pltfigurefigsize
pltbardfTimePeriod' dfmedals color'green'
plttitleBar Graph of Medals Over Time Period'
pltxlabelTime Period'
pltylabelMedals
pltgridTrue
pltshow
QUESTION TO ANSWER Practice : student getting marks in
Consider the above Practice and Practice steps, we require a line graph showing trends based on:
Marks achieved in by subject.
Based on groups score: Semester and Semester
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
