Permalink
Browse files

Correct order of facets when adding layers. Fixes #543

  • Loading branch information...
wch committed Jul 8, 2012
1 parent 259f7b6 commit 31df5ac1ed2b658a7176a29ec61e7580539a4498
Showing with 4 additions and 1 deletion.
  1. +2 −0 R/facet-layout.r
  2. +2 −1 R/panel.r
View
@@ -68,6 +68,8 @@ layout_null <- function(data) {
# Base layout function that generates all combinations of data needed for
# facetting
+# The first data frame in the list should be the default data for the plot.
+# Other data frames in the list are ones that are added to layers.
#
# @params data list of data frames (one for each layer)
# @keywords internal
View
@@ -24,9 +24,10 @@ new_panel <- function() {
# @param the panel object to train
# @param the facetting specification
# @param data a list of data frames (one for each layer), and one for the plot
+# @param plot_data the default data frame
# @return an updated panel object
train_layout <- function(panel, facet, data, plot_data) {
- layout <- facet_train_layout(facet, c(data, list(plot_data)))
+ layout <- facet_train_layout(facet, c(list(plot_data), data))
panel$layout <- layout
panel$shrink <- facet$shrink

0 comments on commit 31df5ac

Please sign in to comment.