Skip to content

Instantly share code, notes, and snippets.

@Perishleaf
Created December 22, 2019 04:52
Show Gist options
  • Save Perishleaf/853147a60d1eb786a0249a6308ca1be2 to your computer and use it in GitHub Desktop.
Save Perishleaf/853147a60d1eb786a0249a6308ca1be2 to your computer and use it in GitHub Desktop.
# Create bar plot for trace2
trace2 = []
for q in Types:
trace2.append(go.Bar(
x=median_price_new.sort_values([q], ascending=False).head(10)[q],
y=median_price_new.sort_values([q], ascending=False).head(10)['Suburb_name_geojson'].str.title().tolist(),
xaxis='x2',
yaxis='y2',
marker=dict(
color='rgba(91, 207, 135, 0.3)',
line=dict(
color='rgba(91, 207, 135, 2.0)',
width=0.5),
),
visible=False,
name='Top 10 suburbs with the highest {} median price'.format(q),
orientation='h',
))
trace2[0]['visible'] = True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment