Skip to content

Figure can accept rects or extents as an dict with keys indicating subplot names#1014

Merged
clewis7 merged 3 commits intomainfrom
extent-rect-named
Mar 17, 2026
Merged

Figure can accept rects or extents as an dict with keys indicating subplot names#1014
clewis7 merged 3 commits intomainfrom
extent-rect-named

Conversation

@kushalkolar
Copy link
Copy Markdown
Member

@kushalkolar kushalkolar commented Mar 17, 2026

I found it tedious creating a lot of custom subplots with defined extents and then assigning names to them separately, easy to get lost:

extents = [
    (0, 0.33, 0.0, 0.25),  # pmd
    (0.33, 0.66, 0.0, 0.25),  # ac
    (0.66, 1, 0.0, 0.5),  # beh left
    (0, 0.33, 0.25, 0.5),  # res
    (0.33, 0.66, 0.25, 0.5),  # bg
    (0.66, 1, 0.5, 1.0),  # beh right
    (0, 0.66, 0.5, 0.75),  # traces
    (0, 0.66, 0.75, 1),  # lightning pose ethogram
]

This PR allows rects or extents to be defined with a dict where keys are subplot names, much easier I think:

extents = {
    "pmd": (0, 0.33, 0.0, 0.25),
    "ac": (0.33, 0.66, 0.0, 0.25)
    "res": (0, 0.33, 0.25, 0.5),
...
}

@clewis7 gtg if tests pass

@kushalkolar kushalkolar requested a review from clewis7 as a code owner March 17, 2026 11:40
@kushalkolar kushalkolar changed the title Figure can accept rects or extents as an OrderedDict with keys indicating subplot names Figure can accept rects or extents as an dict with keys indicating subplot names Mar 17, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 17, 2026

📚 Docs preview built and uploaded! https://www.fastplotlib.org/ver/extent-rect-named

@clewis7 clewis7 merged commit 4a13244 into main Mar 17, 2026
27 of 36 checks passed
@clewis7 clewis7 deleted the extent-rect-named branch March 17, 2026 20:55
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.

2 participants