Skip to content

Commit

Permalink
Add error for non-cartesian coords and free scales
Browse files Browse the repository at this point in the history
  • Loading branch information
wch committed Oct 14, 2012
1 parent 5761df9 commit 272d3cb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions R/facet-wrap.r
Expand Up @@ -101,6 +101,13 @@ 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)) {
stop("ggplot2 does not currently support free scales with a non-cartesian coord or coord_flip.\n")
}

# If user hasn't set aspect ratio, and we have fixed scales, then
# ask the coordinate system if it wants to specify one
aspect_ratio <- theme$aspect.ratio
Expand Down

0 comments on commit 272d3cb

Please sign in to comment.