Created by Ivan Lima on 2019-09-18 21:44:51
Annual fraction of awards and interdisciplinarity across research topics in NSF Ocean Sciences awards. Bubble size is proportional to annual amount awarded in US dollars.
For more information see Lima and Rheuban 2018.
import pandas as pd
import numpy as np
import plotly.express as px
from matplotlib.pyplot import cm
awards_annual = pd.read_csv('results/awards_annual.csv', index_col=0)
awards_annual['amount awarded'] = np.round(awards_annual['amount awarded'],2)
colors20 = (np.array(cm.tab20.colors) * 255).tolist()
color_list = ['rgb({:.0f},{:.0f},{:.0f})'.format(x,y,z) for x,y,z in colors20] # create colormap
fig = px.scatter(awards_annual, x='fraction of awards', y='interdisciplinarity', animation_frame='year',
animation_group='topic', size='amount awarded', color='topic', hover_name='topic',
size_max=65, opacity=0.75, range_x=[0.005,0.175], range_y=[0.05,0.65], height=650,
color_discrete_sequence=color_list, title='NSF Ocean Sciences Awards')
fig.update_xaxes(hoverformat=".3f")
fig.update_yaxes(hoverformat=".3f")
fig.show()