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

Function plot

plotly/__init__.py:81–140  ·  view source on GitHub ↗

Pandas plotting backend function, not meant to be called directly. To activate, set pandas.options.plotting.backend="plotly" See https://github.com/pandas-dev/pandas/blob/master/pandas/plotting/__init__.py

(data_frame, kind, **kwargs)

Source from the content-addressed store, hash-verified

79
80
81def plot(data_frame, kind, **kwargs):
82 """
83 Pandas plotting backend function, not meant to be called directly.
84 To activate, set pandas.options.plotting.backend="plotly"
85 See https://github.com/pandas-dev/pandas/blob/master/pandas/plotting/__init__.py
86 """
87 from .express import (
88 scatter,
89 line,
90 area,
91 bar,
92 box,
93 histogram,
94 violin,
95 strip,
96 funnel,
97 density_contour,
98 density_heatmap,
99 imshow,
100 )
101
102 if kind == "scatter":
103 new_kwargs = {k: kwargs[k] for k in kwargs if k not in ["s", "c"]}
104 return scatter(data_frame, **new_kwargs)
105 if kind == "line":
106 return line(data_frame, **kwargs)
107 if kind == "area":
108 new_kwargs = {k: kwargs[k] for k in kwargs if k not in ["stacked"]}
109 return area(data_frame, **new_kwargs)
110 if kind == "bar":
111 return bar(data_frame, **kwargs)
112 if kind == "barh":
113 return bar(data_frame, orientation="h", **kwargs)
114 if kind == "box":
115 new_kwargs = {k: kwargs[k] for k in kwargs if k not in ["by"]}
116 return box(data_frame, **new_kwargs)
117 if kind in ["hist", "histogram"]:
118 new_kwargs = {k: kwargs[k] for k in kwargs if k not in ["by", "bins"]}
119 return histogram(data_frame, **new_kwargs)
120 if kind == "violin":
121 return violin(data_frame, **kwargs)
122 if kind == "strip":
123 return strip(data_frame, **kwargs)
124 if kind == "funnel":
125 return funnel(data_frame, **kwargs)
126 if kind == "density_contour":
127 return density_contour(data_frame, **kwargs)
128 if kind == "density_heatmap":
129 return density_heatmap(data_frame, **kwargs)
130 if kind == "imshow":
131 return imshow(data_frame, **kwargs)
132 if kind == "heatmap":
133 raise ValueError(
134 "kind='heatmap' not supported plotting.backend='plotly'. "
135 "Please use kind='imshow' or kind='density_heatmap'."
136 )
137
138 raise NotImplementedError(

Callers

nothing calls this directly

Calls 12

scatterFunction · 0.85
lineFunction · 0.85
areaFunction · 0.85
barFunction · 0.85
boxFunction · 0.85
histogramFunction · 0.85
violinFunction · 0.85
stripFunction · 0.85
funnelFunction · 0.85
density_contourFunction · 0.85
density_heatmapFunction · 0.85
imshowFunction · 0.85

Tested by

no test coverage detected