🔵 Data Science  ·  Lesson 40

Matplotlib से Data Visualization

Matplotlib से Data Visualization क्या है?

Matplotlib से Data Visualization ka matlab hai: Data visualization presents data using charts so patterns, trends and comparisons become easier to understand. Simple words me, ye topic practical Python programs likhne me direct use hota hai.

Is topic ko sirf definition ke liye nahi, balki showing marks trends jaise real examples ke liye practice karein.

यह क्यों सीखना जरूरी है?

  • Ye showing marks trends me kaam aata hai.
  • Ye comparing categories se bhi connected hai.
  • Isse aap code ka output aur errors better samajh paate hain.

Important Terms

TermMeaning
plotGraphical representation of data.
bar chartChart used to compare categories.
line chartChart used to show trends over time.
xlabelxlabel is an important term in this topic.
ylabelylabel is an important term in this topic.

Syntax / Basic Pattern

Basic idea: pehle data तैयार करें, phir Python logic apply करें, aur finally result display करें.

Basic Pattern
import matplotlib.pyplot as plt
subjects = ["Maths", "Science", "English"]
marks = [88, 92, 84]
plt.bar(subjects, marks)
plt.title("Subject-wise Marks")
plt.xlabel("Subjects")
plt.ylabel("Marks")
plt.show()

Complete Example Program

Python – data-visualization-matplotlib.py
import matplotlib.pyplot as plt

subjects = ["Maths", "Science", "English"]
marks = [88, 92, 84]

plt.bar(subjects, marks)
plt.title("Subject-wise Marks")
plt.xlabel("Subjects")
plt.ylabel("Marks")
plt.show()

Expected Output

A bar chart will be displayed.

Program Explanation

  • import matplotlib.pyplot as plt imports ready-made features from a module/library.
  • subjects = ["Maths", "Science", "English"] stores a value in subjects.
  • marks = [88, 92, 84] stores a value in marks.
  • plt.bar(subjects, marks) performs the next step of the program logic.
  • plt.title("Subject-wise Marks") performs the next step of the program logic.
  • plt.xlabel("Subjects") performs the next step of the program logic.
  • plt.ylabel("Marks") performs the next step of the program logic.

Practical Uses

  • Showing marks trends.
  • Comparing categories.
  • Making dashboard charts.

Common Mistakes

  • Analysing data before checking missing values, duplicates and data types.
  • Changing original data without keeping a clean copy.
  • Creating charts without title, labels or explanation.

Practice Tasks

  1. Program ko data-visualization-matplotlib.py file me type karke run karein.
  2. Values change karke output compare karein.
  3. showing marks trends par ek छोटा example banayen.
  4. Logic ko apne words me 5 lines me likhein.

सारांश

Data Visualization with Matplotlib ko tab complete maanenge jab aap iska meaning, example, output aur practical use clearly explain kar saken.

← Back to Python Tutorial
🔗

Share this topic with a friend

यह topic किसी दोस्त को भेजें

Found it useful? Send it to a classmate learning the same thing.

अच्छा लगा? जो दोस्त यही सीख रहा है, उसे भेज दीजिए।