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

Method update_legends

plotly/graph_objs/_figure.py:22692–22736  ·  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

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

Callers

nothing calls this directly

Calls 2

select_legendsMethod · 0.95
updateMethod · 0.45

Tested by

no test coverage detected