Created
September 25, 2016 09:00
-
-
Save baptiste/3ce764ef0cac5a9910cec103fefc832a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d <- data.frame(x=1:20, f = gl(2, 10)) | |
p <- ggplot(d, aes(x,x, colour=x)) + facet_grid(.~f) + | |
ggtitle("facetted plot") | |
library(egg) | |
expose_layout(p) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
just thinking out loud really – i've had this idea for a while that a better way to define plot layouts (and by extension other display characteristics) would be to have a dummy template that can be interacted with via direct manipulation. A dummy plot, not showing actual data, but just the skeleton of all object elements a bit like this,
The next step is to have an interactive way of manipulating this template. Ideally some kind of vector graphics editor such as svg-edit, but perhaps more easily a Shiny app with sliders and buttons instead. It makes it easier to adjust various numerical values and keep constraints between different elements. For instance, one could select the font type, font size, justification of all element_text appearing in a theme. The plot margins would be set with a slider. The colours would be selected from a palette, potentially helping with matching colour schemes for the various background/foreground elements.
In fact, the whole thing brings back memories of a similar idea that I suggested years ago to visualise geom default settings.