I've got some data that roughly follows some f(x). To now show the difference against that function, I'd like to transform the coordinate system, so that the f(x) line becomes the horizontal x-axis, and the (previously horizontal) y-grid lines become curves that are labelled on the right and left side of the diagram (like height lines on a map).
I looked at coord_trans, but that only allows to give single-parameter functions for x and y transformations; I'd like some way to specify eg. 1-exp(-x) should become the x-axis line, so the new y-coordinates depend on x as well.
The graph data (points and/or lines) and grid should get transformed as well, of course.
Hi,
I've got some data that roughly follows some
f(x)
. To now show the difference against that function, I'd like to transform the coordinate system, so that thef(x)
line becomes the horizontal x-axis, and the (previously horizontal) y-grid lines become curves that are labelled on the right and left side of the diagram (like height lines on a map).I looked at
coord_trans
, but that only allows to give single-parameter functions for x and y transformations; I'd like some way to specify eg.1-exp(-x)
should become the x-axis line, so the new y-coordinates depend on x as well. The graph data (points and/or lines) and grid should get transformed as well, of course.I already opened https://github.com/tidyverse/ggplot2/issues/2965, and tried to get help at https://community.rstudio.com/t/transforming-coordinate-system/17169, but was now redirected to
ggalt
.Thank you for your patience and help!