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

Method append_trace

plotly/basedatatypes.py:2296–2337  ·  view source on GitHub ↗

Add a trace to the figure bound to axes at the specified row, col index. A row, col index grid is generated for figures created with plotly.tools.make_subplots, and can be viewed with the `print_grid` method Parameters ---------- tra

(self, trace, row, col)

Source from the content-addressed store, hash-verified

2294 print(self._grid_str)
2295
2296 def append_trace(self, trace, row, col):
2297 """
2298 Add a trace to the figure bound to axes at the specified row,
2299 col index.
2300
2301 A row, col index grid is generated for figures created with
2302 plotly.tools.make_subplots, and can be viewed with the `print_grid`
2303 method
2304
2305 Parameters
2306 ----------
2307 trace
2308 The data trace to be bound
2309 row: int
2310 Subplot row index (see Figure.print_grid)
2311 col: int
2312 Subplot column index (see Figure.print_grid)
2313
2314 Examples
2315 --------
2316
2317 >>> from plotly import tools
2318 >>> import plotly.graph_objs as go
2319 >>> # stack two subplots vertically
2320 >>> fig = tools.make_subplots(rows=2)
2321
2322 This is the format of your plot grid:
2323 [ (1,1) x1,y1 ]
2324 [ (2,1) x2,y2 ]
2325
2326 >>> fig.append_trace(go.Scatter(x=[1,2,3], y=[2,1,2]), row=1, col=1)
2327 >>> fig.append_trace(go.Scatter(x=[1,2,3], y=[2,1,2]), row=2, col=1)
2328 """
2329 warnings.warn(
2330 """\
2331The append_trace method is deprecated and will be removed in a future version.
2332Please use the add_trace method with the row and col parameters.
2333""",
2334 DeprecationWarning,
2335 )
2336
2337 self.add_trace(trace=trace, row=row, col=col)
2338
2339 def _set_trace_grid_position(self, trace, row, col, secondary_y=False):
2340 from plotly._subplots import _set_trace_grid_reference

Callers 14

scatterplotFunction · 0.80
scatterplot_dictFunction · 0.80
scatterplot_themeFunction · 0.80
violin_no_colorscaleFunction · 0.80
violin_colorscaleFunction · 0.80
violin_dictFunction · 0.80
_facet_gridFunction · 0.80

Calls 1

add_traceMethod · 0.95