dup_axis ¶
dup_axis(
transform: Callable[[float], float] | None = None,
*,
name: SecondaryName = None,
breaks: SecondaryBreaks = None,
labels: SecondaryLabels = None,
guide: Union = None,
) -> SecondaryAxisSpec
Copy the primary axis to the other side (ggplot2 dup_axis()).
As sec_axis() with every unset option derive()d: the same title,
breaks and labels as the primary axis.
Parameters:
-
transform(callable, default:None) –As in
sec_axis(); the identity by default. -
name(SecondaryName, default:None) –As in
sec_axis(); unset ones arederive(). -
breaks(SecondaryName, default:None) –As in
sec_axis(); unset ones arederive(). -
labels(SecondaryName, default:None) –As in
sec_axis(); unset ones arederive(). -
guide(SecondaryName, default:None) –As in
sec_axis(); unset ones arederive().
Returns:
-
SecondaryAxisSpec–Pass it as
sec_axis=to a continuous position scale.
Raises:
-
UnsupportedValueError–If an option has the wrong type.
-
SpecError–If labels do not match the breaks or the guide is unknown.
Examples:
>>> from ggrust import *
>>> data = {"x": [1, 2, 3], "y": [2.0, 4.5, 3.0]}
>>> plot = ggplot(data, aes("x", "y")) + geom_point() + scale_y_continuous(sec_axis=dup_axis())