Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add "highlight" shading behind groups of subplots #293

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

Open
lukelbd opened this issue Oct 8, 2021 · 0 comments
Open

Add "highlight" shading behind groups of subplots #293

lukelbd opened this issue Oct 8, 2021 · 0 comments
Labels

Comments

@lukelbd
Copy link
Collaborator

lukelbd commented Oct 8, 2021

Follows #291. Adding "highlight" shading behind groups of subplots is the most obvious "subfigure" feature not reproducible with the existing proplot API.

We could implement this by adding keyword arguments to format -- ax.format(highlight=True) adds a patch behind the subplot, subplot_grid[sel1, sel2].format(highlight=True) adds a patch behind the subplots in the selection. Then we can add rc['highlight.color'], rc['highlight.edgecolor'], rc['highlight.linewidth'], and rc['highlight.alpha'] as rc settings to style the patch. Like other rc settings, these can also be passed as keywords to format -- e.g. ax.format(highlight=True, highlightcolor='red').

The extent of the background patch would be determined automatically based on the gridspec (this is the primary advantage of adding this feature rather than leaving users work with mpatches.Rectangle). When "tight layout" is active we can update the background patch based on the tight bounding box, then "padding" the background patch with one half the tight layout padding. When it's inactive we can emit a warning and simply pad halfway between the gridspec spaces/most of the way to the figure border. The padding could also be manually configurable with some other keywords.

@lukelbd lukelbd added the feature label Oct 8, 2021
@lukelbd lukelbd changed the title Add background patch behind groups of subplots Add "highlight" patch behind groups of subplots Oct 8, 2021
@lukelbd lukelbd changed the title Add "highlight" patch behind groups of subplots Add "highlight" shading behind groups of subplots Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant