You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: notebooks/histograms.md
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
---
2
2
jupyter:
3
3
jupytext:
4
+
notebook_metadata_filter: all
4
5
text_representation:
5
6
extension: .md
6
7
format_name: markdown
@@ -110,7 +111,7 @@ fig.show()
110
111
111
112
## Histograms with go.Histogram
112
113
113
-
When data are not available as tidy dataframes, it is also possible to use the more generic `go.Histogram` from `plotly.graph_objs`.
114
+
When data are not available as tidy dataframes, it is also possible to use the more generic `go.Histogram` from `plotly.graph_objs`. All of the available histogram options are described in the histogram section of the reference page: https://plot.ly/python/reference#histogram.
114
115
115
116
### Basic Histogram ###
116
117
@@ -120,9 +121,8 @@ import plotly.graph_objs as go
120
121
import numpy as np
121
122
122
123
x = np.random.randn(500)
123
-
data = [go.Histogram(x=x)]
124
124
125
-
fig = go.Figure(data=data)
125
+
fig = go.Figure(data=[go.Histogram(x=x)])
126
126
fig.show()
127
127
```
128
128
@@ -134,8 +134,7 @@ import plotly.graph_objs as go
134
134
import numpy as np
135
135
136
136
x = np.random.randn(500)
137
-
data = [go.Histogram(x=x,
138
-
histnorm='probability')]
137
+
data = [go.Histogram(x=x, histnorm='probability')]
139
138
140
139
fig = go.Figure(data=data)
141
140
fig.show()
@@ -164,6 +163,7 @@ import plotly.graph_objs as go
164
163
import numpy as np
165
164
166
165
x0 = np.random.randn(500)
166
+
# Add 1 to shift the mean of the Gaussian distribution
167
167
x1 = np.random.randn(500) +1
168
168
169
169
trace0 = go.Histogram(x=x0)
@@ -206,7 +206,7 @@ x1 = np.random.randn(500) + 1
206
206
trace0 = go.Histogram(
207
207
x=x0,
208
208
histnorm='percent',
209
-
name='control', # name used in legend
209
+
name='control', # name used in legend and hover labels
0 commit comments