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
{{ message }}
Repository navigation
coord_fixed() option to force equally-spaced breaks #2888
In most cases that call for coord_fixed(), it is also helpful to have gridlines that are equally spaced along the horizontal and vertical axes, so that the background grid consists of squares. This can be done manually by choosing the same regular breaks (see below), but
this is inconvenient, especially when generating many plots at different scales, and
the internal break_info() functions that automatically produce elegant choices of breaks cannot be used.
It seems natural to have an option, e.g. coord_fixed(breaks = "square"), that generates elegant breaks that (a) occur at the same frequency on both axes and, perhaps optionally, (b) occur at a subset of the same set of equally-spaced values. The default is compared to (a) and (b) below in a simple example. (The option might be useful even for general cartesian coordinates.)
I had a go at building a new Coord*() ggproto, but i quickly realized that it would take a deeper dive into the ggplot2 internals than i'd prepared for. I'm glad to give it a serious try, and to send a PR if it seems to work, but i wanted to check with the maintainers first to be sure i haven't overlooked something and that the feature makes sense.
While I understand the desire to have this functionality, I don't think we should implement this.
In particular, I don't think we should mingle scale functionality into coords when we don't have to.
I do not like that coords have xlim and ylim functionality, as I think that should belong to the scale, and I think giving control over breaks would make this breach of the grammar worse.
I'll go ahead and close this as 'not planned', but we can reopen if other maintainers disagree.
Activity
teunbrand commentedon Mar 5, 2024
While I understand the desire to have this functionality, I don't think we should implement this.
In particular, I don't think we should mingle scale functionality into coords when we don't have to.
I do not like that coords have
xlimandylimfunctionality, as I think that should belong to the scale, and I think giving control over breaks would make this breach of the grammar worse.I'll go ahead and close this as 'not planned', but we can reopen if other maintainers disagree.