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

Function make_half_violin

plotly/figure_factory/_violin.py:41–61  ·  view source on GitHub ↗

Produces a sideways probability distribution fig violin plot.

(x, y, fillcolor="#1f77b4", linecolor="rgb(0, 0, 0)")

Source from the content-addressed store, hash-verified

39
40
41def make_half_violin(x, y, fillcolor="#1f77b4", linecolor="rgb(0, 0, 0)"):
42 """
43 Produces a sideways probability distribution fig violin plot.
44 """
45 text = [
46 "(pdf(y), y)=(" + "{:0.2f}".format(x[i]) + ", " + "{:0.2f}".format(y[i]) + ")"
47 for i in range(len(x))
48 ]
49
50 return graph_objs.Scatter(
51 x=x,
52 y=y,
53 mode="lines",
54 name="",
55 text=text,
56 fill="tonextx",
57 fillcolor=fillcolor,
58 line=graph_objs.scatter.Line(width=0.5, color=linecolor, shape="spline"),
59 hoverinfo="text",
60 opacity=0.5,
61 )
62
63
64def make_violin_rugplot(vals, pdf_max, distance, color="#1f77b4"):

Callers 1

violinplotFunction · 0.85

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected