Created
March 17, 2022 12:48
-
-
Save databyjp/2c98f292d3cdce47d89d453f41014769 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tm_ranks = gdf_tot.groupby("team").sum()["rel_pts"].sort_values().index.to_list() | |
| fig = px.bar(gdf_tot, x="team", facet_row="shot_zone", y="shot_freq", color="rel_ev", | |
| color_continuous_scale=px.colors.diverging.RdYlBu_r, color_continuous_midpoint=0, | |
| category_orders={"team": tm_ranks}) | |
| fig.update_traces(marker=dict(line=dict(width=1, color='DarkSlateGrey'))) | |
| fig.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment