Python Chart is part of data visualization to present data in a graphical format. It helps people understand the significance of data by summarizing and presenting huge amounts of data in a simple and easy-to-understand format and helps communicate information clearly and effectively.
In this article, we will be discussing various Python Charts that help to visualize data in various dimensions such as Histograms, Column charts, Box plot charts, Line charts, and so on.
Python Charts for Data Visualization
In Python there are number of various charts charts that are used to visualize data on the basis of different factors. For exploratory data analysis, reporting, or storytelling we can use these charts as a fundamental tool. Consider this different given Datasets for which we will be plotting different charts:
Histogram
The histogram represents the frequency of occurrence of specific phenomena which lie within a specific range of values and are arranged in consecutive and fixed intervals. In the below code histogram is plotted for Age, Income, Sales,
So these plots in the output show frequency of each unique value for each attribute.
Python
# import pandas and matplotlib
import pandas as pd
import matplotlib.pyplot as plt
# create 2D array of table given above
data = [['E001', 'M', 34, 123, 'Normal', 350],
['E002', 'F', 40, 114, 'Overweight', 450],
['E003', 'F', 37, 135, 'Obesity', 169],
['E004', 'M', 30, 139, 'Underweight', 189],
['E005', 'F', 44, 117, 'Underweight', 183],
['E006', 'M', 36, 121, 'Normal', 80],
['E007', 'M', 32, 133, 'Obesity', 166],
['E008', 'F', 26, 140, 'Normal', 120],
['E009', 'M', 32, 133, 'Normal', 75],
['E010', 'M', 36, 133, 'Underweight', 40] ]
# dataframe created with
# the above data array
df = pd.DataFrame(data, columns = ['EMPID', 'Gender',
'Age', 'Sales',
'BMI', 'Income'] )
# create histogram for numeric data
df.hist()
# show plot
plt.show()
Output:
Histogram Chart
Column Chart
A column chart is used to show a comparison among different attributes, or it can show a comparison of items over time.
Python
# Dataframe of previous code is used here
# Plot the bar chart for numeric values
# a comparison will be shown between
# all 3 age, income, sales
df.plot.bar()
# plot between 2 attributes
plt.bar(df['Age'], df['Sales'])
plt.xlabel("Age")
plt.ylabel("Sales")
plt.show()
Output:

Box plot chart
A box plot is a graphical representation of statistical data based on the minimum, first quartile, median, third quartile, and maximum.
The term "box plot" comes from the fact that the graph looks like a rectangle with lines extending from the top and bottom. Because of the extending lines, this type of graph is sometimes called a box-and-whisker plot.
Python
# For each numeric attribute of dataframe
df.plot.box()
# individual attribute box plot
plt.boxplot(df['Income'])
plt.show()
Output:

Pie Chart
A pie chart shows a static number and how categories represent part of a whole the composition of something. A pie chart represents numbers in percentages, and the total sum of all segments needs to equal 100%.
Python
plt.pie(df['Age'], labels = {"A", "B", "C",
"D", "E", "F",
"G", "H", "I", "J"},
autopct ='% 1.1f %%', shadow = True)
plt.show()
plt.pie(df['Income'], labels = {"A", "B", "C",
"D", "E", "F",
"G", "H", "I", "J"},
autopct ='% 1.1f %%', shadow = True)
plt.show()
plt.pie(df['Sales'], labels = {"A", "B", "C",
"D", "E", "F",
"G", "H", "I", "J"},
autopct ='% 1.1f %%', shadow = True)
plt.show()
Output:

Scatter Chart
A scatter chart shows the relationship between two different variables and it can reveal the distribution trends. It should be used when there are many different data points, and you want to highlight similarities in the data set. This is useful when looking for outliers and for understanding the distribution of your data.
Python
# scatter plot between income and age
plt.scatter(df['income'], df['age'])
plt.show()
Output:

Line Chart
A Line Charts are effective in showing trends over time. By using line plots you can connect data points with straight lines that make it easy to visualize the overall dataset.
Python
import matplotlib.pyplot as plt
# Example: Line Chart
x = [1, 2, 3, 4, 5]
y = [2, 4, 6, 8, 10]
plt.plot(x, y)
plt.xlabel('X-axis Label')
plt.ylabel('Y-axis Label')
plt.title('Line Chart Example')
plt.show()
Output:
LIne Chart
Area Chart
Area Chart are similar to line charts but there is area difference between the line and the x-axis is generally filled. They are helpful generally in showing magnitude over time.
Python
import matplotlib.pyplot as plt
# Example: Area Chart
x = [1, 2, 3, 4, 5]
y = [2, 4, 6, 8, 10]
plt.fill_between(x, y, color='skyblue', alpha=0.4)
plt.xlabel('X-axis Label')
plt.ylabel('Y-axis Label')
plt.title('Area Chart Example')
plt.show()
Output:
Area Chart
Heatmap
Heatmap use coding of color to represent the values of Matrix. Heatmap helps in finding correlations and patterns in large dataset.
Python
import seaborn as sns
import numpy as np
# Example: Heatmap
data = np.random.rand(10, 12)
sns.heatmap(data, cmap='viridis')
plt.title('Heatmap Example')
plt.show()
Output:
HeatMap
Bubble Chart
By using Bubble Chart , you can add third dimension in scatter plot. The bubble chart represents the third variable with the size of the Bubble.
Python
import matplotlib.pyplot as plt
import numpy as np
# Example: Bubble Chart
x = np.random.rand(50)
y = np.random.rand(50)
sizes = np.random.rand(50) * 100
plt.scatter(x, y, s=sizes, alpha=0.5)
plt.title('Bubble Chart Example')
plt.show()
Output:
Bubble Chart
Radar Chart
Radar Chart is ideal chart that displays multivariate data in form of two- dimensional chart. Each variable is present on an axis that radiates on an axis radiating from the center.
Python
import matplotlib.pyplot as plt
import numpy as np
# Example: Radar Chart
categories = ['A', 'B', 'C', 'D', 'E']
values = [4, 2, 5, 3, 1]
angles = np.linspace(0, 2 * np.pi, len(categories), endpoint=False)
values += values[:1]
# Ensure that angles array has the same length as values
angles = np.concatenate((angles, [angles[0]]))
plt.polar(angles, values, marker='o')
plt.title('Radar Chart Example')
plt.show()
Output:
Radar Chart
Conclusion
In conclusion you will delve into the basic realm of Python Charts offers a foundational understanding of visualizing data, these examples provide various Python Charts including histograms, column charts, box plots, pie charts and scatter plots.
Similar Reads
R - Charts and Graphs R language is mostly used for statistics and data analytics purposes to represent the data graphically in the software. To represent those data graphically, charts and graphs are used in R. R - graphs There are hundreds of charts and graphs present in R. For example, bar plot, box plot, mosaic plot
6 min read
Creating Charts using openpyxl Charts are a powerful way to visualize data, making it easier to analyze and present information. While working with Excel files in Python, the library openpyxl comes into the picture and can be used as a tool for automating tasks like reading data, writing data, formatting cells, and of course crea
6 min read
Visualizing Data with Python's Leather Library Data visualization is a crucial aspect of data analysis, enabling data scientists and analysts to interpret complex data sets and derive meaningful insights. Among the myriad of Python libraries available for data visualization, Leather stands out for its simplicity and efficiency. This article delv
8 min read
Matplotlib Cheatsheet [2025 Updated]- Download pdf Mastering data visualization is essential for understanding and presenting data in the best way possible and among the most commonly accessed libraries in Python are the data visualizations that are provided. This "Matplotlib Cheat Sheet" is structured in order to present a quick reference to some o
8 min read
Types of Data Visualization Charts: From Basic to Advanced Data Visualization Charts is a method of presenting data in a visual way. In this guide we'll explore about the different types of data visualization charts in very detailed mannerCharts for Data VisualizationBasic Charts for Data VisualizationThese are the charts you'll face when starting with data
14 min read