MCPcopy Create free account
hub / github.com/plotly/plotly.py / for_each_yaxis

Method for_each_yaxis

plotly/graph_objs/_figurewidget.py:23572–23620  ·  view source on GitHub ↗

Apply a function to all yaxis objects that satisfy the specified selection criteria Parameters ---------- fn: Function that inputs a single yaxis object. selector: dict, function, or None (default None) Dict to use as selectio

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

Source from the content-addressed store, hash-verified

23570 )
23571
23572 def for_each_yaxis(
23573 self, fn, selector=None, row=None, col=None, secondary_y=None
23574 ) -> "FigureWidget":
23575 """
23576 Apply a function to all yaxis objects that satisfy the
23577 specified selection criteria
23578
23579 Parameters
23580 ----------
23581 fn:
23582 Function that inputs a single yaxis object.
23583 selector: dict, function, or None (default None)
23584 Dict to use as selection criteria.
23585 yaxis objects will be selected if they contain
23586 properties corresponding to all of the dictionary's keys, with
23587 values that exactly match the supplied values. If None
23588 (the default), all yaxis objects are selected. If a
23589 function, it must be a function accepting a single argument and
23590 returning a boolean. The function will be called on each
23591 yaxis and those for which the function returned True will
23592 be in the selection.
23593 row, col: int or None (default None)
23594 Subplot row and column index of yaxis objects to select.
23595 To select yaxis objects by row and column, the Figure
23596 must have been created using plotly.subplots.make_subplots.
23597 If None (the default), all yaxis objects are selected.
23598 secondary_y: boolean or None (default None)
23599 * If True, only select yaxis objects associated with the secondary
23600 y-axis of the subplot.
23601 * If False, only select yaxis objects associated with the primary
23602 y-axis of the subplot.
23603 * If None (the default), do not filter yaxis objects based on
23604 a secondary y-axis condition.
23605
23606 To select yaxis objects by secondary y-axis, the Figure must
23607 have been created using plotly.subplots.make_subplots. See
23608 the docstring for the specs argument to make_subplots for more
23609 info on creating subplots with secondary y-axes.
23610 Returns
23611 -------
23612 self
23613 Returns the FigureWidget object that the method was called on
23614 """
23615 for obj in self.select_yaxes(
23616 selector=selector, row=row, col=col, secondary_y=secondary_y
23617 ):
23618 fn(obj)
23619
23620 return self
23621
23622 def update_yaxes(
23623 self,

Callers

nothing calls this directly

Calls 2

select_yaxesMethod · 0.95
fnFunction · 0.50

Tested by

no test coverage detected