Created
June 12, 2020 12:47
-
-
Save BetterProgramming/be53adb6beb33a8aaa634a1f8cee7f1e to your computer and use it in GitHub Desktop.
This file contains 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
sal = df.loc[:,["salary", "gender"]].groupby(["salary", "gender"]).size().reset_index() | |
sal.columns = ["Salary", "Gender", "Count"] | |
fig = px.bar(sal, x='Salary', y='Count', color="Gender", | |
barmode='group', title ="Salary Gender Distribution", | |
height=400, width=2000) | |
fig.update_traces(marker_line_color='rgb(9,50,100)', | |
marker_line_width=1.5, opacity=0.6) | |
fig.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Suggestion: For this visualization, adding a legend would help understand the colors, because you split the visualization.
fig.update_layout(showlegend=True, legend_title_text='Gender')