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
While preparing an answer to Using ggplot2, can I insert a break in the axis? on SO, I noticed that facet_zoom() does not work for horizontal bar charts, i.e., it throws an error when used together with geom_col() and coord_flip():
df <- data.frame(a = c(1,2,3,500), b = c('a1', 'a2','a3', 'a4'))
library(ggforce)
ggplot(df) +
aes(x = b, y = a) +
geom_col() +
coord_flip() +
facet_zoom(ylim = c(0, 10))
Error in scale_index[[i]] : subscript out of bounds
When coord_flip() is removed the code works without any error but creates only vertical bar charts.
Extract from devtools::session_info():
version R version 3.5.3 (2019-03-11)
os Windows 10 x64
...
ggforce * 0.2.2 2019-04-23 [1] CRAN (R 3.5.3)
ggplot2 * 3.1.1 2019-04-07 [1] CRAN (R 3.5.3)
The text was updated successfully, but these errors were encountered:
facet_zoom was never able to work with coord_flip() but other errors prevented the evaluation to reach the point where the facet could inspect the coord and throw an appropriate error. This is now fixed so a better error is thrown
While preparing an answer to Using ggplot2, can I insert a break in the axis? on SO, I noticed that
facet_zoom()
does not work for horizontal bar charts, i.e., it throws an error when used together withgeom_col()
andcoord_flip()
:When
coord_flip()
is removed the code works without any error but creates only vertical bar charts.Extract from
devtools::session_info()
:The text was updated successfully, but these errors were encountered: