0% found this document useful (0 votes)
8 views2 pages

Data Visualization Techniques in Python

The document contains 5 sections showing examples of data visualization using matplotlib in Python. The examples include: 1. Line plots comparing population growth of India and Pakistan from 1960-2020 2. Horizontal bar plot showing programming language usage 3. Histogram comparing blood sugar levels between men and women 4. Multiple line plots with different widths and colors and legends 5. Horizontal bar plot showing growth rates of various countries

Uploaded by

Shobhit Das
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Data Visualization Techniques in Python

The document contains 5 sections showing examples of data visualization using matplotlib in Python. The examples include: 1. Line plots comparing population growth of India and Pakistan from 1960-2020 2. Horizontal bar plot showing programming language usage 3. Histogram comparing blood sugar levels between men and women 4. Multiple line plots with different widths and colors and legends 5. Horizontal bar plot showing growth rates of various countries

Uploaded by

Shobhit Das
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Data Visualization

1. #Data Visualization

import [Link] as plt
year=[1960,1970,1980,1990,2000,2010]
popul_pakistan=[44.91,58.09,78.07,107.7,138.5,
170.6]
popul_india=[449.48,553.57,696.783,870.133,
1000.4,1309.1]
[Link](year,popul_pakistan,color='orange')
[Link](year,popul_india,color='green')
[Link]('Countires')
[Link]('Population In Million')
[Link]('India v/s Pakistan Population till
2020')
[Link]()

2. #Data Visualization

import numpy as np
import [Link] as plt
objects=('Python','C++','Java','Perl','Scala',
'Lisp')
y_pos=[Link](len(objects))
performance=[10,8,6,4,2,1]
[Link](y_pos,performance,align='center',
color='r')
[Link](y_pos, objects)
[Link]('Usage')
[Link]('Programming language usage')
[Link]()

3. #Data Visualization

import [Link] as plt
blood_sugar_man=[113,85,90,150,149,88,93,115,
135,80,77,82,129]
blood_sugar_women=[67,98,89,120,133,150,84,69,
89,79,120,112,100]
[Link]('sugar range')
[Link]('Total no. of patients')
[Link]('blood sugar analysis')
[Link]([blood_sugar_man,blood_sugar_women],
bins=[80,100,125,150],rwidth=0.95,
color=['green','orange'], 
label=['men','women'])
[Link]()
[Link]()
4. #Data Visualization

import [Link] as plt
#line 1 points
x1=[10,20,30]
y1=[20,40,10]
#line 2 points
x2=[10,20,30]
y2=[40,10,30]
[Link]('x-axis')
[Link]('y-axis')
[Link]('Two or more lines with different 
widths and colors with suitable
 legends')
[Link](x1,y1,color='blue',linewidth=3,
label='line1-width-3')
[Link](x2,y2,color='red',linewidth=5,
label='line2-width-5')
[Link]()
[Link]()

5. #Data Visualization

import [Link] as plt
countries=("Brazil","US","Britain",
"Africa","USA","Bangladesh",
"Kinea","Australia")
g_rate=[24,57,48,19,60,15,4,66]
[Link](countries,g_rate,color='g')
[Link](countries)
[Link]('Growth Rates')
[Link]('Countries')
[Link]('Countries with their 
growth rate')
[Link]()

You might also like