1. The document discusses various types of plots that can be created using matplotlib in Python, including line plots, bar graphs, histograms, pie charts, frequency polygons, box plots, and scatter plots.
2. It describes how to customize plots by changing colors, styles, widths, and adding labels, titles, and legends.
3. Examples are provided for creating different plot types like line charts, bar graphs, histograms, and customizing aspects of the plots.
These program are helpful for the beginners who are learning swift .It is helpful for BCA,MCA and B.Tech student for learning the array programs in swift
2D array in C++ language ,define the concept of c++ Two-Dimensional array .with example .and also Accessing Array Components concept.and Processing Two-Dimensional Arrays.
Introduction of arrays, Declaration of array, Initialization of array, Sorting, Multidimensional array. Some code examples that will make you clear about the concept of arrays.
https://github.com/ashim888/csit-c
Why async and functional programming in PHP7 suck and how to get overr it?Lucas Witold Adamus
This presentation describes basic issues related to functional programming with PHP and solution for most of problems served by the library called PhpSlang.
This project is based on Library Management. Python and MySQL are the programming platforms which are used in making of this project.
Subject-Informatics Practices
Class-11/12
Looking for a computer institute to learn Full Stack development and Digital Marketing? Our institute offers comprehensive courses in both areas, providing students with the skills and knowledge needed to succeed in today's digital landscape
These program are helpful for the beginners who are learning swift .It is helpful for BCA,MCA and B.Tech student for learning the array programs in swift
2D array in C++ language ,define the concept of c++ Two-Dimensional array .with example .and also Accessing Array Components concept.and Processing Two-Dimensional Arrays.
Introduction of arrays, Declaration of array, Initialization of array, Sorting, Multidimensional array. Some code examples that will make you clear about the concept of arrays.
https://github.com/ashim888/csit-c
Why async and functional programming in PHP7 suck and how to get overr it?Lucas Witold Adamus
This presentation describes basic issues related to functional programming with PHP and solution for most of problems served by the library called PhpSlang.
This project is based on Library Management. Python and MySQL are the programming platforms which are used in making of this project.
Subject-Informatics Practices
Class-11/12
Looking for a computer institute to learn Full Stack development and Digital Marketing? Our institute offers comprehensive courses in both areas, providing students with the skills and knowledge needed to succeed in today's digital landscape
PYTHON-Chapter 4-Plotting and Data Science PyLab - MAULIK BORSANIYAMaulik Borsaniya
Advanced Topics I: Plotting and Data Science
Plotting using PyLab, Plotting mortgages and extended examples
Data Science Using Python: Data Frame (Creating Data Frame from an Excel Spreadsheet, Creating Data Frame from .csv Files, Creating Data Frame from a Python Dictionary, Creating Data from Python List of Tuples, Operations on Data Frames),
Data Visualization : Bar Graph, Histogram, Creating a Pie Chart, Creating Line Graph
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docxagnesdcarey33086
SAMPLE QUESTION:
Exercise 1: Consider the function
f (x,C)=
sin(C x)
Cx
(a) Create a vector x with 100 elements from -3*pi to 3*pi. Write f as an inline or anonymous function
and generate the vectors y1 = f(x,C1), y2 = f(x,C2) and y3 = f(x,C3), where C1 = 1, C2 = 2 and
C3 = 3. Make sure you suppress the output of x and y's vectors. Plot the function f (for the three
C's above), name the axis, give a title to the plot and include a legend to identify the plots. Add a
grid to the plot.
(b) Without using inline or anonymous functions write a function+function structure m-file that does
the same job as in part (a)
SAMPLE LAB WRITEUP:
MAT 275 MATLAB LAB 1 NAME: __________________________
LAB DAY and TIME:______________
Instructor: _______________________
Exercise 1
(a)
x = linspace(-3*pi,3*pi); % generating x vector - default value for number
% of pts linspace is 100
f= @(x,C) sin(C*x)./(C*x) % C will be just a constant, no need for ".*"
C1 = 1, C2 = 2, C3 = 3 % Using commans to separate commands
y1 = f(x,C1); y2 = f(x,C2); y3 = f(x,C3); % supressing the y's
plot(x,y1,'b.-', x,y2,'ro-', x,y3,'ks-') % using different markers for
% black and white plots
xlabel('x'), ylabel('y') % labeling the axis
title('f(x,C) = sin(Cx)/(Cx)') % adding a title
legend('C = 1','C = 2','C = 3') % adding a legend
grid on
Command window output:
f =
@(x,C)sin(C*x)./(C*x)
C1 =
1
C2 =
2
C3 =
3
(b)
M-file of structure function+function
function ex1
x = linspace(-3*pi,3*pi); % generating x vector - default value for number
% of pts linspace is 100
C1 = 1, C2 = 2, C3 = 3 % Using commans to separate commands
y1 = f(x,C1); y2 = f(x,C2); y3 = f(x,C3); % function f is defined below
plot(x,y1,'b.-', x,y2,'ro-', x,y3,'ks-') % using different markers for
% black and white plots
xlabel('x'), ylabel('y') % labeling the axis
title('f(x,C) = sin(Cx)/(Cx)') % adding a title
legend('C = 1','C = 2','C = 3') % adding a legend
grid on
end
function y = f(x,C)
y = sin(C*x)./(C*x);
end
Command window output:
C1 =
1
C2 =
2
C3 =
3
Joe Bob
Mon lab: 4:30-6:50
Lab 3
Exercise 1
(a) Create function M-file for banded LU factorization
function [L,U] = luband(A,p)
% LUBAND Banded LU factorization
% Adaptation to LUFACT
% Input:
% A diagonally dominant square matrix
% Output:
% L,U unit lower triangular and upper triangular such that LU=A
n = length(A);
L = eye(n); % ones on diagonal
% Gaussian Elimination
for j = 1:n-1
a = min(j+p.
Chart and graphs in R programming language CHANDAN KUMAR
This slide contains basics of charts and graphs in R programming language. I also focused on practical knowledge so I tried to give maximum example to understand the concepts.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
Honest Reviews of Tim Han LMA Course Program.pptxtimhan337
Personal development courses are widely available today, with each one promising life-changing outcomes. Tim Han’s Life Mastery Achievers (LMA) Course has drawn a lot of interest. In addition to offering my frank assessment of Success Insider’s LMA Course, this piece examines the course’s effects via a variety of Tim Han LMA course reviews and Success Insider comments.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
2. Data Visualization
Purpose of plotting;
drawing and saving following types of plots using
matplotlib – line plot, bar graph, histogram, pie
chart, frequency polygon, box plot and scatter
plot.
Customizing plots: color, style (dashed, dotted),
width; adding label, title, and legend in plots.
1
Sangita Panchal
3. Purpose of Plotting 2
Sangita Panchal
One of the most popular uses for Python is data analysis.
Data scientists want a way to visualize their data to get a
better grasp of the data, and to convey their results to
someone.
Matplotlib is a Python library used for plotting. It is used to
create 2d Plots and graphs easily and control font properties,
line controls, formatting axes, etc. through Python script.
4. Line Chart 3
Sangita Panchal
import matplotlib.pyplot as plt
plt.plot([1,2,3],[4,5,1])
plt.show()
import matplotlib.pyplot as plt
plt.plot([4,5,1])
plt.show()
5. Line Chart 3
Sangita Panchal
import matplotlib.pyplot as plt
plt.plot([‘A’,’B’,’C’],[4,5,1])
plt.show()
import matplotlib.pyplot as plt
plt.plot([1,5],[2,6])
plt.show()
6. Line Chart
Try all the commands
4
Sangita Panchal
import matplotlib.pyplot as plt
x = ['A1','B1','C1']
y = [31,27,40]
x1 = ['A1','B1','C1','D1']
y1 = [12,20,19,17]
plt.plot(x,y,label = "Sr. School")
plt.plot(x1,y1,label = "Jr.School")
plt.title("Bus Info")
plt.ylabel("No. of Students")
plt.xlabel("Bus No.")
plt.legend()
plt.savefig("businfo")
plt.show()
Title
xlabel
ylabel Legend
7. Line Chart 5
Sangita Panchal
Save the figure
plt.savefig(“linechart.pdf”)
# saves in the current directory
plt.savefig(“c:datamultibar.pdf”)
# saves in the given path
plt.savefig(“c:datamultibar.png”)
# saves in the given path in .png format
8. Bar Chart 9
Sangita Panchal
import matplotlib.pyplot as plt
# Students in each section
x = ['A','B','C','D','E']
y = [31,27,40,43,45]
plt.bar(x,y,label = "No.of students")
plt.title("Section wise number of students")
plt.ylabel("No. of Students")
plt.xlabel("Section")
plt.legend()
plt.show()
9. Bar Chart Horizontal 10
Sangita Panchal
import matplotlib.pyplot as plt
# Students in each section
x = ['A','B','C','D','E']
y = [31,27,40,43,45]
plt.barh(x,y,label = "No.of students")
plt.title("Section wise number of students")
plt.ylabel("No. of Students")
plt.xlabel("Section")
plt.legend()
plt.show()
10. Bar Chart Stacked 11
Sangita Panchal
import matplotlib.pyplot as plt
# Number of students in each bus
x = [‘A’, ‘B’, ‘C’, ‘D’]
y = [31,27,40,32]
y1 = [12,20,19,17]
plt.bar(x,y,label = "Sr. School")
plt.bar(x,y1,label = "Jr.School")
plt.title("Bus Info")
plt.ylabel("No. of Students")
plt.xlabel("Bus No.")
plt.legend()
plt.show()
11. Bar Chart – Multiple 12
Sangita Panchal
import matplotlib.pyplot as plt
import numpy as np
# Number of students in each bus
x = np.arange(1,5)
y = [31,27,40,32]
y1 = [12,20,19,17]
plt.bar(x+0,y,label = "Sr. School",width = 0.4)
plt.bar(x+0.4,y1,label = "Jr.School",width = 0.4)
plt.title("Bus Info")
plt.ylabel("No. of Students")
plt.xlabel("Bus No.")
plt.legend()
plt.show()
12. Histogram 13
Sangita Panchal
import matplotlib.pyplot as plt
import numpy as np
# Marks obtained by 50 students
x = [5,15,20,25,35,45,55]
y = np.arange(0,61,10)
w = [2,3,8,9,12,6,10]
plt.hist(x,bins = y, weights = w,
label = "Marks Obtained")
plt.title("Histogram")
plt.ylabel("Marks Range")
plt.xlabel("No. of Students")
plt.legend()
plt.show()
13. Histogram 13
Sangita Panchal
import matplotlib.pyplot as plt
import numpy as np
# Marks obtained by 50 students
x = [5,15,20,25,35,45,55,70,84,90,93]
y = [0,33,45,60,75,90,100]
w = [2,3,8,9,12,6,10,5,8,12,7]
plt.hist(x,bins = y, weights = w,
label = "Marks Obtained",
edgecolor = "yellow")
plt.title("Histogram")
plt.ylabel("Marks Range")
plt.xlabel("No. of Students")
plt.legend()
plt.show()
15. Difference between Bar graph and Histogram 14
Sangita Panchal
Histogram Bar
Histogram is defined as a type of bar chart that to
show the frequency distribution of continuous data.
It indicates the number of observations which lie in-
between the range of values, known as class or bin.
Take the observations and split them into logical
series of intervals called bins.
X-axis indicates, independent variables i.e. bins
Y-axis represents dependent variables i.e.
occurrences.
Rectangle blocks i.e. bars are shown on the x-axis,
whose area depends on the bins.
A bar graph is a chart that represents the comparison
between categories of data.
It displays grouped data by way of parallel rectangular
bars of equal width but varying the length.
Each rectangular block indicates specific category and
the length of the bars depends on the values they
hold. The bars do not touch each other.
Bar diagram can be horizontal or vertical, where a
horizontal bar graph is used to display data varying
over space whereas the vertical bar graph represents
time series data. It contains two axis, where one axis
represents the categories and the other axis shows
the discrete values of the data.
16. Difference between Bar graph and Histogram 15
Sangita Panchal
Histogram Bar
A graphical representation to
show the frequency of numerical
data.
A pictorial representation of data
to compare different category of
data.
Bars touch each other, hence
there are no spaces between
bars.
Bars do not touch each other,
hence there are spaces between
bars.
The width of bar may or may not
same (depends on bins)
The width of bar remain same.
17. CBSE Questions 16
Sangita Panchal
Fill in the blanks :
1. The command used to give a heading to a graph is _________
a. plt.show()
b. plt.plot()
c. plt.xlabel()
d. plt.title()
2. Using Python Matplotlib _________ can be used to count how
many values fall into each interval
a. line plot
b. bar graph
c. histogram
18. CBSE Questions 17
Sangita Panchal
Fill in the blanks :
1. The command used to give a heading to a graph is _________
a. plt.show()
b. plt.plot()
c. plt.xlabel()
d. plt.title()
2. Using Python Matplotlib _________ can be used to count how
many values fall into each interval
a. line plot
b. bar graph
c. histogram
plt.title()
histogram
19. CBSE Questions 18
Sangita Panchal
Rashmi wants to plot a bar graph for the department name on x
– axis and number of employees in each department on y-axis.
Complete the code to perform the following:
(i) To plot the bar graph in statement 1
(ii) To display the graph on screen in statement 2
import matplotlib as plt
x = [‘Marketing’, ‘Office’, ‘Manager’, ‘Development’]
y = [ 35, 29, 30, 25]
_______________________________ Statement 1
_______________________________ Statement 2
20. CBSE Questions 19
Sangita Panchal
Rashmi wants to plot a bar graph for the department name on x
– axis and number of employees in each department on y-axis.
Complete the code to perform the following:
(i) To plot the bar graph in statement 1
(ii) To display the graph on screen in statement 2
import matplotlib as plt
x = [‘Marketing’, ‘Office’, ‘Manager’, ‘Development’]
y = [ 35, 29, 30, 25]
_______________________________ Statement 1
_______________________________ Statement 2
plt.bar(x,y)
plt.show()
21. CBSE Questions 20
Sangita Panchal
Anamica wants to draw a line chart using a list of elements
named L. Complete the code to perform the following
operations:
(i) To plot a line chart using the list L
(ii) To give a y-axis label to the line chart as “List of Numbers”
import matplotlib.pyplot as plt
L = [10, 12, 15, 18, 25, 35, 50, 76, 89]
_______________________________ Statement 1
________________________________ Statement 2
plt.show()
22. CBSE Questions 21
Sangita Panchal
Anamica wants to draw a line chart using a list of elements
named L. Complete the code to perform the following
operations:
(i) To plot a line chart using the list L
(ii) To give a y-axis label to the line chart as “List of Numbers”
import matplotlib.pyplot as plt
L = [10, 12, 15, 18, 25, 35, 50, 76, 89]
_______________________________ Statement 1
________________________________ Statement 2
plt.show()
plt.plot(L)
plt.ylabel(“List of Numbers”)
23. CBSE Questions 22
Sangita Panchal
Write a code to plot the speed of a passenger train as shown in
the figure given below.
24. CBSE Questions 23
Sangita Panchal
Write a code to plot the speed of a passenger train as shown in
the figure given below.
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(1, 5)
plt.plot(x, x*2.0, label='Normal')
plt.plot(x, x*3.0, label='Fast')
plt.plot(x, x/2.0, label='Slow')
plt.legend()
plt.show()
26. CBSE Questions 25
Sangita Panchal
Consider the following graph . Write the code to plot it.
SOLUTION 1
import matplotlib.pyplot as plt
plt.plot([2,7],[1,6])
plt.show()
SOLUTION 2
import matplotlib.pyplot as plt
Y = [1,2,3,4,5,6]
X = [2,3,4,5,6,7]
plt.plot (X, Y)
27. CBSE Questions 26
Sangita Panchal
Draw the following bar graph representing the number of
students in each class.
28. CBSE Questions 27
Sangita Panchal
Draw the following bar graph representing the number of students in
each class.
import matplotlib.pyplot as plt
Classes = ['VII','VIII','IX','X']
Students = [40,45,35,44]
plt.bar(classes, students)
plt.show()
29. CBSE Questions 28
Sangita Panchal
Write a code to plot a bar chart to depict the pass
percentage of students in CBSE exams for the last four years
as shown below:
30. CBSE Questions 29
Sangita Panchal
Write a code to plot a bar chart to depict the pass
percentage of students in CBSE exams for the last four years
as shown below:
import matplotlib.pyplot as plt
objects= ["Year1","Year2","Year3","Year4"]
percentage=[82,83,85,90]
plt.bar(objects, percentage)
plt.ylabel("Pass Percentage")
plt.xlabel("Years")
plt.show()
31. CBSE Questions 30
Sangita Panchal
Mr. Vinay wants to plot line charts to compare the trend in the price of diesel and
petrol over the last few weeks from the following data in Python Lists. Help him
write the complete code by filling in the blanks :
(i) To plot the price of diesel in statement 1
(ii) To plot the price of petrol in statement 2
(iii) To give a suitable heading to the graph in statement 3
(iv) To display the legends in statement 4
(v) To display the graph in statement 5
import matplotlib.pyplot as plt
petrol = [ 80 , 82 , 82.50 , 81, 81.50 ]
diesel = [ 73 , 77 , 74 , 74.5 , 75.4 ]
_____________________ Statement 1
_____________________ Statement 2
_____________________ Statement 3
_____________________ Statement 4
_____________________ Statement 5
32. CBSE Questions 31
Sangita Panchal
Mr. Vinay wants to plot line charts to compare the trend in the price of diesel and
petrol over the last few weeks from the following data in Python Lists. Help him
write the complete code by filling in the blanks :
(i) To plot the price of diesel in statement 1
(ii) To plot the price of petrol in statement 2
(iii) To give a suitable heading to the graph in statement 3
(iv) To display the legends in statement 4
(v) To display the graph in statement 5
import matplotlib.pyplot as plt
petrol = [ 80 , 82 , 82.50 , 81, 81.50 ]
diesel = [ 73 , 77 , 74 , 74.5 , 75.4 ]
_____________________ Statement 1
_____________________ Statement 2
_____________________ Statement 3
_____________________ Statement 4
_____________________ Statement 5
plt.plot(diesel)
plt.plot(petrol)
plt.title(‘Price of Diesel vs petrol’)
plt.legend(‘Diesel’,’Petrol’)
plt.show()
33. CBSE Questions 32
Sangita Panchal
Mr. Vinay wants to plot line charts to compare the trend in the price of diesel and petrol over
the last few weeks from the following data in Python Lists. Help him write the complete code
by filling in the blanks :
Following is the data ( in hours ) of screen time spent on a device by sample students:
6,6,5,7,9,7,4,5,4,5,7,8,4,5,7,6,5,7,8,4,3,3,6,5.
The data is plotted to generate a histogram as follows:
Fill in the blanks to complete the code:
(i) To plot the histogram from the given data in Statement1
(ii) To save the figure as “Plot3.png” in Statement2
import matplotlib.pyplot as plt
hours =[6,6,5,7,9,7,4,5,4,5,7,8,4,5,7,6,5,7,8,4,3,3,6,5]
______________________ # Statement1
______________________ # Statement2
34. CBSE Questions 33
Sangita Panchal
Mr. Vinay wants to plot line charts to compare the trend in the price of diesel and petrol over
the last few weeks from the following data in Python Lists. Help him write the complete code
by filling in the blanks :
Following is the data ( in hours ) of screen time spent on a device by sample students:
6,6,5,7,9,7,4,5,4,5,7,8,4,5,7,6,5,7,8,4,3,3,6,5.
The data is plotted to generate a histogram as follows:
Fill in the blanks to complete the code:
(i) To plot the histogram from the given data in Statement1
(ii) To save the figure as “Plot3.png” in Statement2
import matplotlib.pyplot as plt
hours =[6,6,5,7,9,7,4,5,4,5,7,8,4,5,7,6,5,7,8,4,3,3,6,5]
______________________ # Statement1
______________________ # Statement2
plt.hist(hours)
plt.savefig(‘plot3.png’)