Skip to content

Customizable Figure layouts #315

Closed

Description

@kushalkolar

One easy thing we can start with is allowing subplots to be created with bounding boxes that described 0-100 normalized positions and widths. We can also think about more "automated" ways to define the subplots, because it can get quite tedious to write out bboxes for every subplot. The matplotlib gridspec API is kind of tedioius, we can look into other libs for inspiration as well. https://matplotlib.org/stable/gallery/lines_bars_and_markers/scatter_hist.html#defining-the-axes-positions-using-a-gridspec.

subplot1 = [bbox]
subplot2 = [bbox2]
...
gridplot = GridPlot(subplots=[subplot1, subplot2])

image

@clewis7 @ArjunPutcha

Activity

  1. kushalkolar commented on Apr 11, 2024

    @kushalkolar
    MemberAuthor

    Some more ideas:

    • A resize handle in the bottom right corner of subplots and having a mode that makes the subplots moveable would be nice.
    • Moving subplots around the canvas with the mouse
    • right-click menu -> add subplot, once we have UI
  2. kushalkolar commented on Feb 9, 2025

    @kushalkolar
    MemberAuthor

    Some random ideas I got:

    Render rectangle meshes that can be resized, use a camera to render them in screen space. Use these to set the viewport rect of subplots that are rendered on top in a second render pass. Perhaps we can render the bottom rectangle meshes only if events trigger them to resize or if the canvas resizes it has a performance impact.

    Need to figure how to have an automatic mechanism so that when a rectangle is resized the adjacent rectangles resize accordingly. And move and snap behavior would be great too. See how other software that has this does it.

    Axes and ticks can be within these rectangles that frame a subplot.

  3. changed the title [-]API ideas for customizable gridplots[/-] [+]Customizable Figure layouts[/+] on Feb 10, 2025
  4. kushalkolar commented on Feb 16, 2025

    @kushalkolar
    MemberAuthor

    I just realized we can't put the axes in these outer rect meshes because we have subplot docks, they will have to exist within the subplot area itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions