-
Notifications
You must be signed in to change notification settings - Fork 11
sensible defaults and unittest #189
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
Conversation
Thanks for the prompt response! Adding an rc param would be helpful, especially when a figure contains multiple colorbars and users want to remove their frames. |
@ToryDeng Done. New rc params is defined as |
Codecov ReportAttention: Patch coverage is 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refines the colorbar label placement by introducing a new keyword "labelrotation" with sensible default behaviors and a new keyword "outline" to toggle the colorbar's frame.
- Adds tests to validate label rotation functionality and auto rotation settings.
- Introduces new rc parameter "colorbar.outline" for managing colorbar frame visibility.
- Updates the _add_colorbar function to incorporate labelrotation and outline parameters for enhanced customization.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
ultraplot/tests/test_colorbar.py | Added tests for label rotation including auto and fixed rotation. |
ultraplot/internals/rcsetup.py | Added rc parameter for toggling colorbar outlines. |
ultraplot/axes/base.py | Updated _add_colorbar to support labelrotation and outline options. |
Co-authored-by: Copilot <[email protected]>
Doubting on making the label on the side default hor, but otherwise fine with the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment here.
Any preferences for the horizontal labels @ToryDeng not sure what to do here. |
Yes horizontal labels may not be always good for horizontal colorbars with labels to the left or right. I think vertical labels could be set as the default in this case. Just provide users with options to adjust if needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more items.
* Introduces new rc param. Th parameter `colorbar.outline` defaults to `True` and toggles the outline frame of the colorbar. * Allows figure colorbar label to be put on arbitrary side of the figure. --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Matthew R. Becker <[email protected]>
* Introduces new rc param. Th parameter `colorbar.outline` defaults to `True` and toggles the outline frame of the colorbar. * Allows figure colorbar label to be put on arbitrary side of the figure. --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Matthew R. Becker <[email protected]>
The community indicated (@ToryDeng) that colorbar label placing may need some TLC. We recently introduced placing colorbar labels along the outside of the colorbar. This may cause unnecessary post processing as currently the placingo f the labels is not stylized. This PR adds sensible label placement for colorbars. It adds a new keyword
labelrotation
which is set to default to "auto" or can be set to any arbitrary number; please note the the alignment is then null and void.Furthermore, it adds the keyword
outline
which allows for turning on and off the outline frame of the colorbar.Addresses #181
@TorryDeng do you want to include an rc param for the frame or is this sufficient?