Add warning for non-cartesian coords and free scales #675

Closed
wants to merge 1 commit into
from

1 participant

@wch
Collaborator

This fixes #673.

@hadley hadley commented on the diff Sep 25, 2012
R/facet-wrap.r
@@ -101,6 +101,14 @@ facet_map_layout.wrap <- function(facet, data, layout) {
#' @S3method facet_render wrap
facet_render.wrap <- function(facet, panel, coord, theme, geom_grobs) {
+ # If coord is (non-cartesian or flip) and (x is free or y is free)
+ # then print a warning
+ if ((!inherits(coord, "cartesian") || inherits(coord, "flip")) &&
+ (facet$free$x || facet$free$y)) {
+ warning("When free scales are used with a non-cartesian coord or with coord_flip,\n",
@hadley
Owner
hadley added a line comment Sep 25, 2012

I think this could be stronger - i.e. stop and "ggplot2 does not currently support the combination of ..."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@wch
Collaborator

OK, I changed it to to an error, then rebased and merged at 272d3cb.

@wch wch closed this Oct 14, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment