Closed IsabelMarleen closed 1 year ago
Thanks for the bug report, @IsabelMarleen!
plot_model()
is one piece of ggplot2 voodoo, but I suspect this has something to do with adjusting an 0-valued coordinates of the "bottom-most" geoms when log = TRUE
is set. I.e. what's being dealt with here w.r.t. to the population polygons themselves.
I wonder if an analogous ifelse
trick can be done with the terminal points of the gene-flow arrows? Makes sense, I think?
Although I do wonder why this doesn't give a warning, because it shouldn't be possible to plot y = 0 coordinates anyway?
This is just a quick analysis post-lunch -- I'll have to think about it more once do food coma passes. :)
I think you are right. It does give a warning: Transformation introduced infinite values in continuous y-axis
. I should have included it, I think I subconsciously assumed any issue like that would affect the arrow and the block equally and ignored it. I just tested what happens when both populations and the migration end at 1 instead of 0 and then the arrow works correctly. So there is probably an extra check included for populations ending at 0 on log scale but not for the arrows.
This should be fixed now.
@IsabelMarleen: I'm not sure if you discovered this issue by accident or if this prevented some of your demes-r models from plotting properly. If the former, feel free to ignore this message. If it's the later, maybe check if everything works as expected now?
When using
plot_model()
withlog=TRUE
, the migration arrows are not adjusted to the new scale, so arrows end in the wrong place.Small reproducible example: