0% found this document useful (0 votes)
34 views13 pages

Lab6 7

This document provides an overview and introduction to the Python visualization library Matplotlib. It discusses key features of Matplotlib including its ability to create common plot types like line plots, scatter plots, histograms, bar charts and more. It also covers subplots, saving plots, and using Matplotlib to create a histogram from image data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views13 pages

Lab6 7

This document provides an overview and introduction to the Python visualization library Matplotlib. It discusses key features of Matplotlib including its ability to create common plot types like line plots, scatter plots, histograms, bar charts and more. It also covers subplots, saving plots, and using Matplotlib to create a histogram from image data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

LAB 6-7

data visualization and image


histogram
Computer Vision
Second semester
Third stage
Computer department
College of science
2022-2023
Prepared by Tara Qadr
Overview of Python Visualization Tools
• Matplotlib
• Seaborn
• pandas
• Bokeh
• Plotly
• ggplot
• pygal
Introduction to Matplotlib
• Matplotlib is the basic plotting library of Python programming language.
• It is the most prominent tool among Python visualization packages.
• Matplotlib is highly efficient in performing wide range of tasks.
• It can produce publication quality figures in a variety of formats.
• It can export visualizations to all of the common formats like PDF, SVG, JPG,
PNG, BMP and GIF.
• It can create popular visualization types – line plot, scatter plot, histogram,
bar chart, error charts, pie chart, box plot, and many more types of plot.
• Matplotlib also supports 3D plotting. Many Python libraries are built on top
of Matplotlib.
• pandas and Seaborn are built on Matplotlib. They allow to access
Matplotlib’s methods with less code.
Bar plot
Transparency
value
line plot
Scatter Plot
Activity
• Draw two plot in same time using line plot
Subplot
Activity
• Make 2 row and 2 column subplot with previous data.
Saving Plot

'tight' option is used here to remove any extra white space around the plot.
Another charts…
• Pie Chart

• Boxplot

• Error bar
Image data to histogram
• img.ravel() is a NumPy function that returns a flattened 1-
dimensional array of the input array img.
• For example, if img is a 2D NumPy array with dimensions (height,
width), img.ravel() would return a 1D array of shape (height*width,)
that contains all the elements of the original array in a flattened
order.
• 256: This parameter specifies the number of bins in the histogram
• [0,255]: This parameter specifies the range of pixel intensities

You might also like