MCPcopy Index your code
hub / github.com/plotly/plotly.py / _Distplot

Class _Distplot

plotly/figure_factory/_distplot.py:261–441  ·  view source on GitHub ↗

Refer to TraceFactory.create_distplot() for docstring

Source from the content-addressed store, hash-verified

259
260
261class _Distplot(object):
262 """
263 Refer to TraceFactory.create_distplot() for docstring
264 """
265
266 def __init__(
267 self,
268 hist_data,
269 histnorm,
270 group_labels,
271 bin_size,
272 curve_type,
273 colors,
274 rug_text,
275 show_hist,
276 show_curve,
277 ):
278 self.hist_data = hist_data
279 self.histnorm = histnorm
280 self.group_labels = group_labels
281 self.bin_size = bin_size
282 self.show_hist = show_hist
283 self.show_curve = show_curve
284 self.trace_number = len(hist_data)
285 if rug_text:
286 self.rug_text = rug_text
287 else:
288 self.rug_text = [None] * self.trace_number
289
290 self.start = []
291 self.end = []
292 if colors:
293 self.colors = colors
294 else:
295 self.colors = [
296 "rgb(31, 119, 180)",
297 "rgb(255, 127, 14)",
298 "rgb(44, 160, 44)",
299 "rgb(214, 39, 40)",
300 "rgb(148, 103, 189)",
301 "rgb(140, 86, 75)",
302 "rgb(227, 119, 194)",
303 "rgb(127, 127, 127)",
304 "rgb(188, 189, 34)",
305 "rgb(23, 190, 207)",
306 ]
307 self.curve_x = [None] * self.trace_number
308 self.curve_y = [None] * self.trace_number
309
310 for trace in self.hist_data:
311 self.start.append(min(trace) * 1.0)
312 self.end.append(max(trace) * 1.0)
313
314 def make_hist(self):
315 """
316 Makes the histogram(s) for FigureFactory.create_distplot().
317
318 :rtype (list) hist: list of histogram representations

Callers 1

create_distplotFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected