File tree 1 file changed +40
-35
lines changed
packages/python/plotly/plotly/figure_factory
1 file changed +40
-35
lines changed Original file line number Diff line number Diff line change @@ -183,20 +183,10 @@ def create_distplot(
183
183
if isinstance (bin_size , (float , int )):
184
184
bin_size = [bin_size ] * len (hist_data )
185
185
186
- hist = _Distplot (
187
- hist_data ,
188
- histnorm ,
189
- group_labels ,
190
- bin_size ,
191
- curve_type ,
192
- colors ,
193
- rug_text ,
194
- show_hist ,
195
- show_curve ,
196
- ).make_hist ()
186
+ data = []
187
+ if show_hist :
197
188
198
- if curve_type == "normal" :
199
- curve = _Distplot (
189
+ hist = _Distplot (
200
190
hist_data ,
201
191
histnorm ,
202
192
group_labels ,
@@ -206,9 +196,42 @@ def create_distplot(
206
196
rug_text ,
207
197
show_hist ,
208
198
show_curve ,
209
- ).make_normal ()
210
- else :
211
- curve = _Distplot (
199
+ ).make_hist ()
200
+
201
+ data .append (hist )
202
+
203
+ if show_curve :
204
+
205
+ if curve_type == "normal" :
206
+ curve = _Distplot (
207
+ hist_data ,
208
+ histnorm ,
209
+ group_labels ,
210
+ bin_size ,
211
+ curve_type ,
212
+ colors ,
213
+ rug_text ,
214
+ show_hist ,
215
+ show_curve ,
216
+ ).make_normal ()
217
+ else :
218
+ curve = _Distplot (
219
+ hist_data ,
220
+ histnorm ,
221
+ group_labels ,
222
+ bin_size ,
223
+ curve_type ,
224
+ colors ,
225
+ rug_text ,
226
+ show_hist ,
227
+ show_curve ,
228
+ ).make_kde ()
229
+
230
+ data .append (curve )
231
+
232
+ if show_rug :
233
+
234
+ rug = _Distplot (
212
235
hist_data ,
213
236
histnorm ,
214
237
group_labels ,
@@ -218,26 +241,8 @@ def create_distplot(
218
241
rug_text ,
219
242
show_hist ,
220
243
show_curve ,
221
- ).make_kde ()
244
+ ).make_rug ()
222
245
223
- rug = _Distplot (
224
- hist_data ,
225
- histnorm ,
226
- group_labels ,
227
- bin_size ,
228
- curve_type ,
229
- colors ,
230
- rug_text ,
231
- show_hist ,
232
- show_curve ,
233
- ).make_rug ()
234
-
235
- data = []
236
- if show_hist :
237
- data .append (hist )
238
- if show_curve :
239
- data .append (curve )
240
- if show_rug :
241
246
data .append (rug )
242
247
layout = graph_objs .Layout (
243
248
barmode = "overlay" ,
You can’t perform that action at this time.
0 commit comments