Data Visualization
Data Visualization
plt.plot(x, y, ‘colorname’)
CREATED BY: SACHIN BHARDWAJ, PGT (CS) KV NO.1 TEZPUR, MR. VINOD
KUMAR VERMA, PGT (CS) KV OEF KANPUR
Program:
Output:
Changing line color and line width and
line style :
Changing Marker Type, Size and Color
Bar Graph
A bar graph is used to represents data in the form of vertical or horizontal bars.
It is useful to compare the quantities.
Changing Width, Color in Bar Chart :
Example 2-
Horizontal Bar Graph:
barh() is used to draw horizontal bar graph.
Output-
Multiple Bar Graph:
To draw multiple bar chart:
Shadow option-
Shadow= True indicates that the pie chart should be
displayed with a shadow. This will improve the look of the
chart.
For example- we can collect the age of each employee in an office and
show it in the form of a histogram to know how many employees are
there in the range 0-10 years, 10-20 years and so on. For this we can
create histogram like this-
Example 2-
Output-
Output-
1. Maximum
2. 2. Minimum
3. 1st Quartile
4. 2ND Quartile (Median)
5. 3RD Quartile
Example 1-
Example 2-
If notch=True creates a
notched box plot otherwise
creates rectangular box plot
Marker Description
‘s’ Square Marker
‘o’ Circle Marker
‘d’ Diamond Marker
‘x’ Cross Marker
‘+’ Plus Marker
‘^’ Triangle down
‘v’ Triangle Up
Example 1-
Example -2
Saving Plots or Chartsor graph to file