hrbrmstr / ggalt

:earth_americas: Extra Coordinate Systems, Geoms, Statistical Transformations & Scales for 'ggplot2'
https://cran.r-project.org/web/packages/ggalt/vignettes/ggalt_examples.html
Other
654 stars 99 forks source link

Feature Request: coordinate transformation to show deviation from an expected function #52

Open phmarek opened 5 years ago

phmarek commented 5 years ago

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 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.

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!