hi,
i am including a function that generates a go.Bar graph inside a plotly Dash app inside a bcc.Card. the problem is I am not able to change the background color of the graph to black or transparent, i tried using ‘#00000’, or rgba(0,0,0,0), with no luck. the code is shown below.
def Stats(G):
degree = nx.degree_centrality(G)
betweenness = nx.betweenness_centrality(G)
degree_df = pd.DataFrame({‘node’: [x[0] for x in sorted(degree.items(), key=lambda x:x[1], reverse=True)] , ‘Stat’:‘Degree’, ‘Value’: [x[1] for x in sorted(degree.items(), key=lambda x:x[1], reverse=True)]})
betweenness_df = pd.DataFrame({‘node’: [x[0] for x in sorted(betweenness.items(), key=lambda x:x[1], reverse=True)] , ‘Stat’:‘Betweenness’, ‘Value’: [x[1] for x in sorted(betweenness.items(), key=lambda x:x[1], reverse=True)]})
bar_df = degree_df.head(5).append(betweenness_df.head(5))[[‘node’, ‘Stat’, ‘Value’]]data = px.bar(bar_df, x="Stat", y="Value", color="node", title="Top Five", orientation='v') layout = go.Layout(title = "General Stats", template = 'plotly_dark', paper_bgcolor ='rgb(0,0,0)', plot_bgcolor='rgb(0,0,0)', xaxis = go.XAxis(title = 'Dieharder Tests', showticklabels=False),) fig = go.Figure(data, layout) return fig
what could be the problem?
Thanks