Students can read the important questions given below for Data Visualization Using Pyplot Class 12 Computer Science. All Data Visualization Using Pyplot Class 12 Notes and questions with solutions have been prepared based on the latest syllabus and examination guidelines issued by CBSE, NCERT and KVS. You should read all notes provided by us and Class 12 Computer Science Important Questions provided for all chapters to get better marks in examinations. Computer Science Question Bank Class 12 is available on our website for free download in PDF.
Important Questions of Data Visualization Using Pyplot Class 12
Very Short Answer Type Questions :
Question: Name the interface of matplotlib used for drawing 2-D graphs.
Answer: pyplot
Question: Which function is used to add title to plot?
Answer: title()
Question: Which function is used to label axes in a plot?
Answer: xlabel() and ylabel()
Question: What is visualization of Data? How to use Pyplot for it?
Answer: Data visualization is the discipline of trying to understand data by placing it in a visual context so that patterns, trends and correlations that might not otherwise be detected can be exposed.
Question: What is bar chart?
Answer: Bar chart is a graphical display of dat using bars of different heights.
Question: Which function is to be use for draw a line in Pyplot Python?
Answer: plot()
Question: Which function is to be use for draw bar chart in Pyplot Python?
Answer: bar()
Question: What is pie chart?
Answer: Pie chart is a type of graph in which circle is divided into sectors that represent proportion of the whole.
Question: Which packages of Python is use to draw 2-D graphics?
Answer: Matplotlib
Question: Which function is to be use for draw pie chart in Pyplot Python?
Answer: pie()
Short Answer Type Questions :
Question: Why is following code giving error?
Answer: a=range(1,10,2)
b=range(10,100,10)
matplotlib.pyplot.plot(a,b)
Answer: the above code is producing error because two sequences a and b do not match in shape. List a is having 5 values and b list is having 9 values.
Question: Write the python program to plot pie chart for share=[17.4,25,5.2,35.2] and Zones=[‘North’,’South’,’East’,’West’].
Answer: import matplotlib.pyplot as plt
share=[17.4,25,5.2,35.2]
Zones=[‘North’,’South’,’East’,’West’]
plt.pie(share,labels=Zones)
plt.show()
Question: Write the python code to plot bar chart for sales in different cities.
Answer: import matplotlib.pyplot as plt
p1 = [‘Agra’,’Delhi’,’Kolkata’,’Chennai’]
p2 = [10,23,19,26]
plt.xlabel(‘Cities’)
plt.ylabel(‘Sales figure in Lakhs’)
plt.bar(p1,p2)
plt.show()
Question: Write the python program to create line chart for 10x+4.
Answer: import matplotlib.pyplot as plt
X=[1,2,3,4]
Y=10*X+4
plt.plot(X, Y)
plt.show()
Question: Write the python program to create bar plot for class and its strength.
Answer: import matplotlib.pyplot as plt
C=[‘X’,’XI’,’XII’]
S=[160,152,136]
plt.xlabel(‘Classes’)
plt.ylabel(‘Strength’)
plt.bar(C,S)
plt.show()
Question: Write the python program to plot pie chart of popular languages among students.
Answer: import matplotlib.pyplot as plt
Labels=[‘.Net’,‘Python’,’C++’,Java’]
Sizes=[190,250,200,230]
plt.pie(Sizes,labels=Labels)
plt.show()
Question: How to use Pyplot for visualization of Data?
Answer:
import matplotlib.pyplot as plt
x=[1,2,3,4]
y=[20,30,40,50]
plt.plot(x, y)
plt.show()
Question: Write the python program to plot pie chart for share=[29,30,21,13,7] and
stream=[‘SCIENCE’,’HUMANITIES’,’COMMERCE’,’VOCATIONAL,’FMM’].
Answer: import matplotlib.pyplot as plt
share=[29,30,21,13,7]
stream=[‘SCIENCE’,’HUMANITIES’,’COMMERCE’,’VOCATIONAL,’FMM’].
plt.pie(share,labels=stream)
plt.show()
Question: What is line graph? Write the python code for line graph.
Answer: Line chart is a type of chart which displays information as a series of data points called markers connected by straight line segments.
import matplotlib.pyplot as plt
p1 = [1,20]
p2 = [6,70]
plt.plot(x, y)
plt.show()