-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use the isoband package to calculate contour lines and bands #3439
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! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Geom
s 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:
complete
parameter 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
,binwidth
andbreaks
. 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).