Repository navigation
Use the isoband package to calculate contour lines and bands - #3439
Conversation
|
A few more notes:
|
|
I had a quick look and didn't see anything that concerns me. I'll be traveling extensively over the next two weeks, starting today. Therefore, you probably shouldn't wait for a more careful review from me, unless there's anything you feel uncertain about. |
|
I appreciate you taking a look! When ggplot2 is ready for scale access at draw time, I imagine I will have many more questions! |
hadley
left a comment
There was a problem hiding this comment.
While you're in here, it would be useful to quickly profile this code, just to see if there are any major bottlenecks we could improve.
|
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
This is a PR to address #3044. While the desired behaviour (calculating contours at draw time that can be labeled) can't be done immediately because
Geoms don't have access to non-position scales, a good start is to use @clauswilke's isoband package to calculate contour lines (as opposed togrDevices::contourLines()) instat_contour(). The isoband package also has a function to return contour polygons, which are implemented in this PR asstat_contour_filled()andgeom_contour_filled().Additional refactoring steps were:
completeparameter is not used in the current calculation and hasn't been used for about 4 years (estimated from the git blame view), so I removed it.bins,binwidthandbreaks. These appeared in examples but were not function arguments and were not documented.Things I am not sure about:
geom_contour_filled(). There is noGeomContourFilled, it just callslayer()withstat = "contour_filled"andgeom = "polygon".isoband::iso(band|contour), but I think I should probably add more tests to make sure inappropriate/weird inputs are handled properly (such as for Proposal: Warning when using density2d + coord_map #2702).