View Categories

Types of Charts

Types of Charts in Data Science #

Charts help visualize data for better understanding, pattern detection, and decision making.

Line Chart #

  • Purpose: Show trends over time
  • Example: Stock prices over months
  • Tools: Python (matplotlib), Excel
  • Code Example:
import matplotlib.pyplot as plt
x = [1,2,3,4]
y = [10,20,15,25]
plt.plot(x, y)
plt.title("Line Chart Example")
plt.show()

Bar Chart #

  • Purpose: Compare categories
  • Example: Sales of different products
  • Tools: Python (matplotlib), Excel
  • Code Example:
x = ['A','B','C']
y = [10,20,15]
plt.bar(x, y)
plt.title("Bar Chart Example")
plt.show()

Pie Chart #

  • Purpose: Show proportions of a whole
  • Example: Market share of companies
  • Tools: Python (matplotlib), Excel
  • Code Example:
labels = ['X','Y','Z']
sizes = [30,50,20]
plt.pie(sizes, labels=labels, autopct='%1.1f%%')
plt.title("Pie Chart Example")
plt.show()

Histogram #

  • Purpose: Show distribution of data
  • Example: Age distribution of customers
  • Tools: Python (matplotlib), Excel
  • Code Example:
data = [22,25,22,30,28,30,25]
plt.hist(data, bins=5)
plt.title("Histogram Example")
plt.show()

Scatter Plot #

  • Purpose: Show relationship between two variables
  • Example: Height vs Weight
  • Tools: Python (matplotlib, seaborn), Excel
  • Code Example:
x = [1,2,3,4]
y = [10,20,15,25]
plt.scatter(x, y)
plt.title("Scatter Plot Example")
plt.show()
Chart TypePurposeExampleTools/TechniquesCode Example (Python)
Line ChartShow trends over timeStock prices over monthsPython (matplotlib), Excelplt.plot(x, y); plt.show()
Bar ChartCompare categoriesSales of productsPython (matplotlib), Excelplt.bar(x, y); plt.show()
Pie ChartShow proportions of a wholeMarket sharePython (matplotlib), Excelplt.pie(sizes, labels=labels, autopct='%1.1f%%'); plt.show()
HistogramShow data distributionAge distribution of customersPython (matplotlib), Excelplt.hist(data, bins=5); plt.show()
Scatter PlotShow relationship between two variablesHeight vs WeightPython (matplotlib, seaborn), Excelplt.scatter(x, y); plt.show()

💬
AIRA (AI Research Assistant) Neural Learning Interface • Drag & Resize Enabled
×