Skip to content

Instantly share code, notes, and snippets.

@lucharo
Last active October 6, 2020 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucharo/b68b8e8621b6cbe7bf5f75c85db397ac to your computer and use it in GitHub Desktop.
Save lucharo/b68b8e8621b6cbe7bf5f75c85db397ac to your computer and use it in GitHub Desktop.
Populate plotly.graph_objects.Figure['layout']
fig['layout'] = go.Layout(
font = {'size' : 14},
plot_bgcolor = 'white',
xaxis = {'showline': True,
'visible': True,
'range': (0, data['Value'].max()),
'title_text': 'Production Quantity (tonnes)' # title of the x axis
},
yaxis = {'showline': False,
'visible': True, # to show the title
'showticklabels': False, # to avoid displaying the names
'title_text': 'Top ' + str(top_entries) + ' Crops'}, # title of the y axis
bargap = 0.15, # number btwn 0 and 1, sets gap between adjacent bars (as plot fraction)
title = 'Top 10 Crops across time' # sets title for default plot
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment