You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Someone told me geom_abline() doesn't look nice when we increase the size. To be fair, geom_function() seems better at the first example, but it has the same problem when the range of the scale is shorter or equal to the coord's range. I think this is intentional, but it might be nice if there's some option to draw lines to outside of the plot area.
(Btw, maybe this is a good chance to replace GeomAbline with GeomFunction...?)
Just a thought, if somebody wants to tackle this: It may be necessary to make expansion configurable, in case somebody wants to draw an abline but turn off clipping. Expansion could also cause weird effects in nonlinear coordinate systems.
Hmm... so this is a bit more involved than how it looks on the outside, at least for geom_function(). Since the coordinates used by geom_function() is calculated by stat_function() any values outside the range of the scales will be censored and removed by default - circumventing this will require some nasty hacks that aren't warranted I think...
It is easier for geom_abline() because the very modest calculations all happens in the draw methods of the geom so the scale doesn't have a chance to censor the values.
I propose we fix this for geom_abline() only - to address @clauswilke's point we could simply only expand the range if the coord is clipping and not polar
An interesting observation regarding this. The graphics engine will cut geometries to fit into the drawing area before passing it off to the device. This is done for historical reasons since some of the early graphic devices couldn't handle coordinates outside of their drawing area. I knew about this and have asked Paul to allow opt-out of this (mostly for performance reasons). A side effect of this behaviour can be seen here:
If the panel is very close to the edge and the line width is very large there is nothing we can do for graphic devices that doesn't opt out