Skip to content
Benjamin LeRoy edited this page Mar 4, 2022 · 2 revisions

Note

The following is related to early thoughts on package development. Please see the official package documentation for support.


I'm guessing this will just be a place to put ideas and discuss things ~ Ben

On package potential

In the notes/proof_of_concept.py document, I provide some an example using svg. I have code for png as well, but currently, I think they have similar problems, and svg is better.

In either approach, a problem arises that you either need to rescale the images after they're created or have "small-than-expected" images situated in each block. For the later, examples of this can be examined by changing the proposed_scaling_both function to proposed_scaling and then changing the hjust and vjust parameters to examine different alignments.

When I was working on the png approach (though this applied to svg as well?) I imagined we could try to "recorrect" the text and object sizes (points, lines, etc) of the plots after knowing the scaling - though this is harder if the height and width scales are different.

Package design

I imagined this package trying have similar attributes to gridExtra, cowplot and patchwork.

General structure of each:

  1. patchwork
  2. gridExtra
    • allows for defining of layout_matrix (like in the notes/proof_of_concept.py's top, e.g.
    np.array([[1,1,2,2],
              [1,1,0,0]])
    • allows for title texts at top, bottom, left, right
    • allows for varying width of rows and columns
  3. cowpatch
    • allows for subplot titles / labels
    • allows for different ways to define layouts than gridExtra (with text, e.g.
    """
    1122
    11##
    """

Clone this wiki locally