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

Method update_legends

plotly/graph_objs/_figurewidget.py:22696–22740  ·  view source on GitHub ↗

Perform a property update operation on all legend objects that satisfy the specified selection criteria Parameters ---------- patch: dict Dictionary of property updates to be applied to all legend objects that satisfy the selection cr

(
        self, patch=None, selector=None, overwrite=False, row=None, col=None, **kwargs
    )

Source from the content-addressed store, hash-verified

22694 return self
22695
22696 def update_legends(
22697 self, patch=None, selector=None, overwrite=False, row=None, col=None, **kwargs
22698 ) -> "FigureWidget":
22699 """
22700 Perform a property update operation on all legend objects
22701 that satisfy the specified selection criteria
22702
22703 Parameters
22704 ----------
22705 patch: dict
22706 Dictionary of property updates to be applied to all
22707 legend objects that satisfy the selection criteria.
22708 selector: dict, function, or None (default None)
22709 Dict to use as selection criteria.
22710 legend objects will be selected if they contain
22711 properties corresponding to all of the dictionary's keys, with
22712 values that exactly match the supplied values. If None
22713 (the default), all legend objects are selected. If a
22714 function, it must be a function accepting a single argument and
22715 returning a boolean. The function will be called on each
22716 legend and those for which the function returned True will
22717 be in the selection.
22718 overwrite: bool
22719 If True, overwrite existing properties. If False, apply updates
22720 to existing properties recursively, preserving existing
22721 properties that are not specified in the update operation.
22722 row, col: int or None (default None)
22723 Subplot row and column index of legend objects to select.
22724 To select legend objects by row and column, the Figure
22725 must have been created using plotly.subplots.make_subplots.
22726 If None (the default), all legend objects are selected.
22727 **kwargs
22728 Additional property updates to apply to each selected
22729 legend object. If a property is specified in
22730 both patch and in **kwargs then the one in **kwargs
22731 takes precedence.
22732 Returns
22733 -------
22734 self
22735 Returns the FigureWidget object that the method was called on
22736 """
22737 for obj in self.select_legends(selector=selector, row=row, col=col):
22738 obj.update(patch, overwrite=overwrite, **kwargs)
22739
22740 return self
22741
22742 def select_maps(self, selector=None, row=None, col=None):
22743 """

Callers

nothing calls this directly

Calls 2

select_legendsMethod · 0.95
updateMethod · 0.45

Tested by

no test coverage detected