Closed joekeane7 closed 1 year ago
In case it is any help, I came across this issue on SO, and think it might be a bug that appears to be in the interpolateDataFrame()
function.
yes that was me, I posted on both forums as seemed relevant. The solution on https://stackoverflow.com/questions/74614700/issue-using-geom-link2-with-after-stat-when-using-facet-wrap was great thanks.
I guess it is still an issue with geom_link2 but I'm happy to close from my perspective.
Library Dependencies:
Create Data Frame
Create ggplot using ggforces - geom_link2 (facet_wrap applied)
Create ggplot using ggforces - geom_link2 (facet_wrap not applied)
My code gives me this output with facet applied:
With facet_wrap commented into code, you can see the after_stat function y<targt1 field doesn't work correctly in the W1 panel; the issue seems to be around the first point. It works correctly with the point in W2 as you can see
and this without facet applied:
Comment out the facet_wrap section to see the difference, this is correct but without facets which are needed
The second is correct but obviously without the necessary facets. Why doesn't my after_stat calculation within geom_link2 work with facets?
I'm hoping for someone to show me where I am going wrong with my after_stat function/facet_wrap/geom_link2.
I'm not 100% sure where my issue is, but if the target is changed to 0.201 the code works fine as you can see below:
targt1 = 0.201
However as soon as the targt1 is change to anything over 0.202 the code falls down and the line is red rather than green under the target:
targt1 = 0.202
I based my initial code on the answer given here and it works in most cases but seems to fail in the circumstances I have displayed above:
https://stackoverflow.com/questions/66817508/how-make-line-red-when-the-value-is-below-zero-and-green-when-above/66817776