FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
scripts/interactive_visualization.py at main · epythonlab/scripts · GitHub
epythonlab
/
scripts
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
scripts
/
interactive_visualization.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
30 lines (26 loc) · 657 Bytes
Breadcrumbs
scripts
/
interactive_visualization.py
Copy path
File metadata and controls
30 lines (26 loc) · 657 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""
Create an Interactive Data visualization using Plotly
"""
# pip install plotly
import
plotly
.
express
as
px
data
=
px
.
data
.
gapminder
()
fig
=
px
.
scatter
(
data_frame
=
data
,
x
=
'gdpPercap'
,
y
=
'lifeExp'
,
size
=
'pop'
,
color
=
'continent'
,
hover_name
=
'country'
,
log_x
=
True
,
range_x
=
[
300
,
100000
],
range_y
=
[
20
,
90
],
title
=
'GDP per Capita VS Life Expetancy'
,
labels
=
{
'gdpPercap'
:
'GDP per Capita'
,
'lifeExp'
:
'Life Expetancy'
},
template
=
'plotly_dark'
)
# update the axis
fig
.
update_xaxes
(
title_text
=
'GDP per Capita(log scale)'
)
fig
.
update_yaxes
(
title_text
=
'Life Expetancy'
)
# show the graph
fig
.
show
()
Back
|
FazBrowse Home
|
New Git URL