Skip to content

Better subplot interface #526

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 37 commits into from
May 16, 2016
Merged

Better subplot interface #526

merged 37 commits into from
May 16, 2016

Conversation

cpsievert
Copy link
Collaborator

@cpsievert cpsievert commented Mar 19, 2016

Stuff left to do:

  • Scale shapes/annotations appropriately. Here's a nice working example:
# once this is working well, we can wrap it up, and have a special build for 'ggmatrix' objects
pm <- GGally::ggpairs(reshape::tips[, 1:3])
plotList <- list()
for (i in seq_len(pm$nrow)) {
  for (j in seq_len(pm$ncol)) {
    plotList <- c(plotList, list(pm[i, j]))
  }
}
do.call(subplot, c(plotList, list(nrows = 3)))

@cpsievert
Copy link
Collaborator Author

@talgalili for the second todo item, I'm thinking of adding widths and heights arguments, a la, grid.arrange(). I also think it's most sensible to specify these on a 0-1 scale, so you could recreate that example (in #376) like this:

subplot(hist_top, empty, scatter, hist_right, nrows=2, widths=c(0.8, 0.2), heights=c(0.2, 0.8))

@cpsievert cpsievert changed the title first stab at subplot rewrite Better subplot interface Mar 24, 2016
@cpsievert
Copy link
Collaborator Author

The message below was automatically generated after build https://travis-ci.org/ropensci/plotly/builds/130484030

Detected 38 differences ->

http://cpsievert.github.io/plotly-test-table/f8bbcb2/3-panels
http://cpsievert.github.io/plotly-test-table/f8bbcb2/all-shapes
http://cpsievert.github.io/plotly-test-table/f8bbcb2/barley
http://cpsievert.github.io/plotly-test-table/f8bbcb2/cookbook-axes-scatter-facet
http://cpsievert.github.io/plotly-test-table/f8bbcb2/cookbook-axes-scatter-facet-hline
http://cpsievert.github.io/plotly-test-table/f8bbcb2/cookbook-axes-scatter-facet-hline-vline
http://cpsievert.github.io/plotly-test-table/f8bbcb2/facet_grid_free
http://cpsievert.github.io/plotly-test-table/f8bbcb2/facet_grid_free_x
http://cpsievert.github.io/plotly-test-table/f8bbcb2/facet_grid_free_y
http://cpsievert.github.io/plotly-test-table/f8bbcb2/facet_grid-labeller
http://cpsievert.github.io/plotly-test-table/f8bbcb2/facet_wrap
http://cpsievert.github.io/plotly-test-table/f8bbcb2/facet_wrap_free
http://cpsievert.github.io/plotly-test-table/f8bbcb2/facet_wrap_free_mult
http://cpsievert.github.io/plotly-test-table/f8bbcb2/facet_wrap_free_x
http://cpsievert.github.io/plotly-test-table/f8bbcb2/facet_wrap_free_y
http://cpsievert.github.io/plotly-test-table/f8bbcb2/facet_wrap-labeller
http://cpsievert.github.io/plotly-test-table/f8bbcb2/histogram-fill-factor-facets
http://cpsievert.github.io/plotly-test-table/f8bbcb2/jitter-basic
http://cpsievert.github.io/plotly-test-table/f8bbcb2/map-facet
http://cpsievert.github.io/plotly-test-table/f8bbcb2/plotly-subplot-geo-cartesian
http://cpsievert.github.io/plotly-test-table/f8bbcb2/plotly-subplot-ggmatrix
http://cpsievert.github.io/plotly-test-table/f8bbcb2/plotly-subplot-group
http://cpsievert.github.io/plotly-test-table/f8bbcb2/plotly-subplot-plot-list
http://cpsievert.github.io/plotly-test-table/f8bbcb2/plotly-subplot-recursive
http://cpsievert.github.io/plotly-test-table/f8bbcb2/plotly-subplot-shareBoth
http://cpsievert.github.io/plotly-test-table/f8bbcb2/plotly-subplot-shareX
http://cpsievert.github.io/plotly-test-table/f8bbcb2/plotly-subplot-shareY
http://cpsievert.github.io/plotly-test-table/f8bbcb2/plotly-subplot-simple
http://cpsievert.github.io/plotly-test-table/f8bbcb2/plotly-subplot-simple2
http://cpsievert.github.io/plotly-test-table/f8bbcb2/plotly-subplot-width-height
http://cpsievert.github.io/plotly-test-table/f8bbcb2/scatterplots-geom_jitter
http://cpsievert.github.io/plotly-test-table/f8bbcb2/scatterplots-jitter
http://cpsievert.github.io/plotly-test-table/f8bbcb2/smooth-facet
http://cpsievert.github.io/plotly-test-table/f8bbcb2/ticks-boxes-facet-grid
http://cpsievert.github.io/plotly-test-table/f8bbcb2/ticks-boxes-scales-free
http://cpsievert.github.io/plotly-test-table/f8bbcb2/ticks-boxes-space-free
http://cpsievert.github.io/plotly-test-table/f8bbcb2/ticks-flip-grid
http://cpsievert.github.io/plotly-test-table/f8bbcb2/ticks-flip-grid-free

@cpsievert
Copy link
Collaborator Author

The message below was automatically generated after build https://travis-ci.org/ropensci/plotly/builds/130495204

Detected 38 differences ->

http://cpsievert.github.io/plotly-test-table/0acbbc0/3-panels
http://cpsievert.github.io/plotly-test-table/0acbbc0/all-shapes
http://cpsievert.github.io/plotly-test-table/0acbbc0/barley
http://cpsievert.github.io/plotly-test-table/0acbbc0/cookbook-axes-scatter-facet
http://cpsievert.github.io/plotly-test-table/0acbbc0/cookbook-axes-scatter-facet-hline
http://cpsievert.github.io/plotly-test-table/0acbbc0/cookbook-axes-scatter-facet-hline-vline
http://cpsievert.github.io/plotly-test-table/0acbbc0/facet_grid_free
http://cpsievert.github.io/plotly-test-table/0acbbc0/facet_grid_free_x
http://cpsievert.github.io/plotly-test-table/0acbbc0/facet_grid_free_y
http://cpsievert.github.io/plotly-test-table/0acbbc0/facet_grid-labeller
http://cpsievert.github.io/plotly-test-table/0acbbc0/facet_wrap
http://cpsievert.github.io/plotly-test-table/0acbbc0/facet_wrap_free
http://cpsievert.github.io/plotly-test-table/0acbbc0/facet_wrap_free_mult
http://cpsievert.github.io/plotly-test-table/0acbbc0/facet_wrap_free_x
http://cpsievert.github.io/plotly-test-table/0acbbc0/facet_wrap_free_y
http://cpsievert.github.io/plotly-test-table/0acbbc0/facet_wrap-labeller
http://cpsievert.github.io/plotly-test-table/0acbbc0/histogram-fill-factor-facets
http://cpsievert.github.io/plotly-test-table/0acbbc0/jitter-basic
http://cpsievert.github.io/plotly-test-table/0acbbc0/map-facet
http://cpsievert.github.io/plotly-test-table/0acbbc0/plotly-subplot-geo-cartesian
http://cpsievert.github.io/plotly-test-table/0acbbc0/plotly-subplot-ggmatrix
http://cpsievert.github.io/plotly-test-table/0acbbc0/plotly-subplot-group
http://cpsievert.github.io/plotly-test-table/0acbbc0/plotly-subplot-plot-list
http://cpsievert.github.io/plotly-test-table/0acbbc0/plotly-subplot-recursive
http://cpsievert.github.io/plotly-test-table/0acbbc0/plotly-subplot-shareBoth
http://cpsievert.github.io/plotly-test-table/0acbbc0/plotly-subplot-shareX
http://cpsievert.github.io/plotly-test-table/0acbbc0/plotly-subplot-shareY
http://cpsievert.github.io/plotly-test-table/0acbbc0/plotly-subplot-simple
http://cpsievert.github.io/plotly-test-table/0acbbc0/plotly-subplot-simple2
http://cpsievert.github.io/plotly-test-table/0acbbc0/plotly-subplot-width-height
http://cpsievert.github.io/plotly-test-table/0acbbc0/scatterplots-geom_jitter
http://cpsievert.github.io/plotly-test-table/0acbbc0/scatterplots-jitter
http://cpsievert.github.io/plotly-test-table/0acbbc0/smooth-facet
http://cpsievert.github.io/plotly-test-table/0acbbc0/ticks-boxes-facet-grid
http://cpsievert.github.io/plotly-test-table/0acbbc0/ticks-boxes-scales-free
http://cpsievert.github.io/plotly-test-table/0acbbc0/ticks-boxes-space-free
http://cpsievert.github.io/plotly-test-table/0acbbc0/ticks-flip-grid
http://cpsievert.github.io/plotly-test-table/0acbbc0/ticks-flip-grid-free

@cpsievert cpsievert merged commit dd9a3fa into master May 16, 2016
@cpsievert cpsievert deleted the fix/subplot branch May 16, 2016 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant