Answers for "histogram plotly with title"

0

histogram plotly with title

import plotly.graph_objects as go

import numpy as np

x0 = np.random.randn(2000)
x1 = np.random.randn(2000) + 1

fig = go.Figure()
fig.add_trace(go.Histogram(x=x0))
fig.add_trace(go.Histogram(x=x1))

# The two histograms are drawn on top of another
fig.update_layout(barmode='stack')

fig.update_layout(title='<b>Title</b>',
                   xaxis_title='<b>x</b>',
                   yaxis_title='<b>y</b>')
fig.show()
Posted by: Guest on May-27-2021

Python Answers by Framework

Browse Popular Code Answers by Language