{"action":"created","issue":{"url":"https://api.github.com/repos/hafen/geofacet/issues/92","repository_url":"https://api.github.com/repos/hafen/geofacet","labels_url":"https://api.github.com/repos/hafen/geofacet/issues/92/labels{/name}","comments_url":"https://api.github.com/repos/hafen/geofacet/issues/92/comments","events_url":"https://api.github.com/repos/hafen/geofacet/issues/92/events","html_url":"https://github.com/hafen/geofacet/issues/92","id":305350865,"number":92,"title":"Issue with overplotting when using a second data set to fill panel","user":{"login":"hathawayj","id":6199492,"avatar_url":"https://avatars1.githubusercontent.com/u/6199492?v=4","gravatar_id":"","url":"https://api.github.com/users/hathawayj","html_url":"https://github.com/hathawayj","followers_url":"https://api.github.com/users/hathawayj/followers","following_url":"https://api.github.com/users/hathawayj/following{/other_user}","gists_url":"https://api.github.com/users/hathawayj/gists{/gist_id}","starred_url":"https://api.github.com/users/hathawayj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hathawayj/subscriptions","organizations_url":"https://api.github.com/users/hathawayj/orgs","repos_url":"https://api.github.com/users/hathawayj/repos","events_url":"https://api.github.com/users/hathawayj/events{/privacy}","received_events_url":"https://api.github.com/users/hathawayj/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-14T22:25:18Z","updated_at":"2018-03-14T22:41:02Z","closed_at":"2018-03-14T22:26:45Z","author_association":"NONE","body":"I have an example below.  When I run it the `facet_wrap()` works as expected with the `idaho_total` data added through `geom_rect()`.  However, `facet_geo()` doesn't seem to facet the label or color to the respective panel.  Any help on a solution would be appreciated.\r\n\r\n``` r\r\nlibrary(tidyverse)\r\nlibrary(geofacet)\r\n\r\nidaho_grid <- data.frame(\r\n  code_fip = c(\"021\", \"017\", \"055\", \"079\", \"009\", \"035\", \"057\", \"069\", \"059\", \"061\", \"049\", \"043\", \"033\", \"085\", \"003\", \"037\", \"081\", \"065\", \"051\", \"023\", \"015\", \"087\", \"045\", \"019\", \"011\", \"013\", \"025\", \"075\", \"039\", \"063\", \"047\", \"001\", \"027\", \"053\", \"067\", \"077\", \"005\", \"029\", \"007\", \"041\", \"071\", \"031\", \"083\", \"073\"),\r\n  name = c(\"Boundary\", \"Bonner\", \"Kootenai\", \"Shoshone\", \"Benewah\", \"Clearwater\", \"Latah\", \"Nez Perce\", \"Lemhi\", \"Lewis\", \"Idaho\", \"Fremont\", \"Clark\", \"Valley\", \"Adams\", \"Custer\", \"Teton\", \"Madison\", \"Jefferson\", \"Butte\", \"Boise\", \"Washington\", \"Gem\", \"Bonneville\", \"Bingham\", \"Blaine\", \"Camas\", \"Payette\", \"Elmore\", \"Lincoln\", \"Gooding\", \"Ada\", \"Canyon\", \"Jerome\", \"Minidoka\", \"Power\", \"Bannock\", \"Caribou\", \"Bear Lake\", \"Franklin\", \"Oneida\", \"Cassia\", \"Twin Falls\", \"Owyhee\"),\r\n  row = c(1, 2, 3, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12),\r\n  col = c(1, 1, 1, 2, 1, 2, 1, 2, 4, 1, 2, 8, 7, 3, 2, 4, 9, 8, 7, 6, 3, 1, 2, 8, 7, 6, 4, 1, 3, 5, 4, 2, 1, 5, 6, 7, 8, 9, 9, 8, 7, 6, 4, 1),\r\n  stringsAsFactors = FALSE\r\n)\r\n\r\n\r\nidaho_time <- read_csv(\"http://byuistats.github.io/M335/data/idaho_time.csv\")\r\n#> Parsed with column specification:\r\n#> cols(\r\n#>   name = col_character(),\r\n#>   year = col_integer(),\r\n#>   value = col_integer()\r\n#> )\r\nidaho_total <- read_csv(\"http://byuistats.github.io/M335/data/idaho_total.csv\")\r\n#> Parsed with column specification:\r\n#> cols(\r\n#>   code_fip = col_character(),\r\n#>   name = col_character(),\r\n#>   permits = col_integer()\r\n#> )\r\n\r\nidaho_total %>%\r\n  ggplot() +\r\n  geom_rect(aes(fill = permits),\r\n            xmin = -Inf, ymin = -Inf, xmax = Inf, ymax = Inf, inherit.aes = FALSE) +\r\n  facet_wrap(~name, scales = \"free_y\") +\r\n  scale_fill_viridis_c(trans = \"sqrt\") +\r\n  theme_bw() +\r\n  theme(strip.text = element_text(size = 8), strip.background = element_rect(fill = NA))\r\n```\r\n\r\n![](https://i.imgur.com/zcQVmRZ.png)\r\n\r\n``` r\r\n\r\nidaho_total %>%\r\n  ggplot() +\r\n  geom_rect(aes(fill = permits),\r\n            xmin = -Inf, ymin = -Inf, xmax = Inf, ymax = Inf, inherit.aes = FALSE) +\r\n  facet_geo(~name, scales = \"free_y\", grid = idaho_grid) +\r\n  scale_fill_viridis_c(trans = \"sqrt\") +\r\n  theme_bw() +\r\n  theme(strip.text = element_text(size = 8), strip.background = element_rect(fill = NA))\r\n#> Note: You provided a user-specified grid. If this is a\r\n#>   generally-useful grid, please consider submitting it to become a\r\n#>   part of the geofacet package. You can do this easily by calling:\r\n#>   grid_submit(__grid_df_name__)\r\n```\r\n\r\n![](https://i.imgur.com/brAjJAK.png)\r\n\r\n``` r\r\n\r\n\r\nidaho_time %>%\r\n  ggplot(aes(x = year, y = value)) +\r\n  geom_rect(data = idaho_total, aes(fill = permits),\r\n            xmin = -Inf, ymin = -Inf, xmax = Inf, ymax = Inf, inherit.aes = FALSE) +\r\n  geom_point() + geom_line() +\r\n  geom_label(data = idaho_total, x = 2005, y = -Inf, aes(label = scales::comma_format()(permits)), vjust = -1, color = \"black\") +\r\n  scale_x_continuous(breaks = c(2000, 2005, 2010), labels = c(\"00\", \"05\", \"10\")) +\r\n  facet_wrap(~name, scales = \"free_y\") +\r\n  scale_fill_viridis_c(trans = \"sqrt\") +\r\n  theme_bw() +\r\n  theme(strip.text = element_text(size = 8), strip.background = element_rect(fill = NA), panel.spacing = unit(0.1, \"lines\"))\r\n```\r\n\r\n![](https://i.imgur.com/dMnAqho.png)\r\n\r\n``` r\r\n\r\nidaho_time %>%\r\n  ggplot(aes(x = year, y = value)) +\r\n  geom_rect(data = idaho_total, aes(fill = permits),\r\n            xmin = -Inf, ymin = -Inf, xmax = Inf, ymax = Inf, inherit.aes = FALSE) +\r\n  geom_point() + geom_line() +\r\n  geom_label(data = idaho_total, x = 2005, y = -Inf, aes(label = scales::comma_format()(permits)), vjust = -1, color = \"black\") +\r\n  scale_x_continuous(breaks = c(2000, 2005, 2010), labels = c(\"00\", \"05\", \"10\")) +\r\n  facet_geo(~name, scales = \"free_y\", grid = idaho_grid, label = \"name\") +\r\n  scale_fill_viridis_c(trans = \"sqrt\") +\r\n  theme_bw() +\r\n  theme(strip.text = element_text(size = 8), strip.background = element_rect(fill = NA), panel.spacing = unit(0.1, \"lines\"))\r\n#> Note: You provided a user-specified grid. If this is a\r\n#>   generally-useful grid, please consider submitting it to become a\r\n#>   part of the geofacet package. You can do this easily by calling:\r\n#>   grid_submit(__grid_df_name__)\r\n```\r\n\r\n![](https://i.imgur.com/VZl2Xbj.png)\r\n\r\nCreated on 2018-03-14 by the [reprex package](http://reprex.tidyverse.org) (v0.2.0)."},"comment":{"url":"https://api.github.com/repos/hafen/geofacet/issues/comments/373199143","html_url":"https://github.com/hafen/geofacet/issues/92#issuecomment-373199143","issue_url":"https://api.github.com/repos/hafen/geofacet/issues/92","id":373199143,"user":{"login":"hathawayj","id":6199492,"avatar_url":"https://avatars1.githubusercontent.com/u/6199492?v=4","gravatar_id":"","url":"https://api.github.com/users/hathawayj","html_url":"https://github.com/hathawayj","followers_url":"https://api.github.com/users/hathawayj/followers","following_url":"https://api.github.com/users/hathawayj/following{/other_user}","gists_url":"https://api.github.com/users/hathawayj/gists{/gist_id}","starred_url":"https://api.github.com/users/hathawayj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hathawayj/subscriptions","organizations_url":"https://api.github.com/users/hathawayj/orgs","repos_url":"https://api.github.com/users/hathawayj/repos","events_url":"https://api.github.com/users/hathawayj/events{/privacy}","received_events_url":"https://api.github.com/users/hathawayj/received_events","type":"User","site_admin":false},"created_at":"2018-03-14T22:41:02Z","updated_at":"2018-03-14T22:41:02Z","author_association":"NONE","body":"Thanks for the quick response.\r\n"}}
{"actor":{"display_login":"hathawayj"}}