Bishwajit Ghose

python

test post

# gapminder
import plotly_express as px
import pandas as pd
pd.plotting.register_matplotlib_converters()
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns
import numpy as np

from gapminder import gapminder
gapminder.head()

Visualizing gapminder data in python

# gapminder
import plotly_express as px
import pandas as pd
pd.plotting.register_matplotlib_converters()
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns
import numpy as np

from gapminder import gapminder
gapminder.head()


#scatter
fig = px.scatter(gapminder,
                 x="Income",
                 y="Life Expectancy",
                 size="Population",
                 size_max=60,
                 color="Region",
                 hover_name="Country",
                 facet_col="Income Level",
                 color_discrete_sequence=["#FF69B4", "#87CEFA",
                                          "#FFFF00", "#32CD32"],
                 range_y=[50, 90],
                 width=1000,
                 labels={"Income": "Income in $s",
                         "Life Expectancy": "Life Expectancy in years"},
                 title="World Map for Health and Wealth (data from 2018)",
                 opacity=1
                 )

fig.layout.xaxis1.update(matches=None)
fig.layout.xaxis2.update(matches=None)
fig.layout.xaxis3.update(matches=None)
fig.layout.xaxis4.update(matches=None)
py.iplot(fig, sharing='public', filename='factfulness_bubble_chart_2018')

p.head()