Last active
October 6, 2020 16:42
-
-
Save lucharo/b68b8e8621b6cbe7bf5f75c85db397ac to your computer and use it in GitHub Desktop.
Populate plotly.graph_objects.Figure['layout']
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
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