derive ¶
derive() -> DerivedSpec
Take a secondary axis option from the primary axis (ggplot2 derive()).
Returns:
-
DerivedSpec–A marker for
sec_axis(name=, breaks=, labels=, guide=).
Examples:
>>> from ggrust import *
>>> data = {"day": [1, 2, 3, 4], "celsius": [12.0, 15.5, 21.0, 18.5]}
>>> plot = ggplot(data, aes("day", "celsius")) + geom_line()
>>> plot = plot + scale_y_continuous(sec_axis=sec_axis(lambda c: c * 1.8 + 32, name=derive()))