parallel_axes: Draw parallel axes with a linear transform

scale_shiftR Documentation

Draw parallel axes with a linear transform

Description

Draws two parallel axes. The lower axis shows the input to the function without a scaled input, e.g. the input to the pattern book function. The upper axis shows the input that goes into the scaling before being handed off to the pattern-book function.

Usage

scale_shift(min, max, r, x0 = 0, nticks = 10, color = "blue")

plot_scaled_input(ftilde, domain, r, x0, nticks = 10, color = "blue")

Arguments

min

lower end of domain

max

upper end of domain

r

r parameter in linear scaling r*(x-x0)

x0

x0 parameter in linear scaling r*(x-x0)

nticks

number of ticks on new axis (add_scale)

color

color of new axis (e.g. "blue")

ftilde

tilde expression as in slice_plot()

domain

domain specifier as in slice_plot()

Details

plot_scaled_input() is for drawing pattern-book functions on their natural unscaled input (plain "x"), but then adds a second scale that shows the input to the scaled function.

Only handles linear transformations: r*(x-x0)

Value

a ggplot2 object

Examples

scale_shift(-40, 100, 9/5, 32, 10, color="magenta")
plot_scaled_input(exp(x) ~ x, domain(x=c(-2,2)), 2.4, 1)


dtkaplan/Znotes documentation built on Sept. 4, 2022, 10:21 a.m.