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

Method select_legends

plotly/graph_objs/_figurewidget.py:22630–22660  ·  view source on GitHub ↗

Select legend subplot objects from a particular subplot cell and/or legend subplot objects that satisfy custom selection criteria. Parameters ---------- selector: dict, function, or None (default None) Dict to use as selection criteria.

(self, selector=None, row=None, col=None)

Source from the content-addressed store, hash-verified

22628 return self
22629
22630 def select_legends(self, selector=None, row=None, col=None):
22631 """
22632 Select legend subplot objects from a particular subplot cell
22633 and/or legend subplot objects that satisfy custom selection
22634 criteria.
22635
22636 Parameters
22637 ----------
22638 selector: dict, function, or None (default None)
22639 Dict to use as selection criteria.
22640 legend objects will be selected if they contain
22641 properties corresponding to all of the dictionary's keys, with
22642 values that exactly match the supplied values. If None
22643 (the default), all legend objects are selected. If a
22644 function, it must be a function accepting a single argument and
22645 returning a boolean. The function will be called on each
22646 legend and those for which the function returned True will
22647 be in the selection.
22648 row, col: int or None (default None)
22649 Subplot row and column index of legend objects to select.
22650 To select legend objects by row and column, the Figure
22651 must have been created using plotly.subplots.make_subplots.
22652 If None (the default), all legend objects are selected.
22653 Returns
22654 -------
22655 generator
22656 Generator that iterates through all of the legend
22657 objects that satisfy all of the specified selection criteria
22658 """
22659
22660 return self._select_layout_subplots_by_prefix("legend", selector, row, col)
22661
22662 def for_each_legend(self, fn, selector=None, row=None, col=None) -> "FigureWidget":
22663 """

Callers 2

for_each_legendMethod · 0.95
update_legendsMethod · 0.95

Tested by

no test coverage detected