job-fair / util /plot.py
Zekun Wu
update
cd0fc76
raw
history blame
866 Bytes
import pandas as pd
import plotly.graph_objs as go
def create_sector_plot(df, sector_name):
fig = go.Figure()
fig.add_trace(go.Scatter(
x=df.index, y=df['Privilege_Avg_Score'],
mode='lines+markers', name='Privilege',
text=df['Role'], hoverinfo='text+y'
))
fig.add_trace(go.Scatter(
x=df.index, y=df['Protect_Avg_Score'],
mode='lines+markers', name='Protection',
text=df['Role'], hoverinfo='text+y'
))
fig.add_trace(go.Scatter(
x=df.index, y=df['Neutral_Avg_Score'],
mode='lines+markers', name='Neutral',
text=df['Role'], hoverinfo='text+y'
))
fig.update_layout(
title=f'{sector_name} Sector Scores',
xaxis_title='Resume Index',
yaxis_title='Score',
legend_title='Score Type',
hovermode='closest'
)
return fig