-
Notifications
You must be signed in to change notification settings - Fork 399
[Feature] add zorder #1049
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
base: main
Are you sure you want to change the base?
[Feature] add zorder #1049
Conversation
@@ -410,7 +417,7 @@ def draw_texts( | |||
font_families: Union[str, List[str]] = 'sans-serif', | |||
bboxes: Optional[Union[dict, List[dict]]] = None, | |||
font_properties: Optional[Union['FontProperties', | |||
List['FontProperties']]] = None | |||
List['FontProperties']]] = None, |
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.
suggestion: Union['FontProperties', List['FontProperties'], None] = None,
@@ -615,6 +625,7 @@ def draw_circles( | |||
line_widths: Union[Union[int, float], List[Union[int, float]]] = 2, | |||
face_colors: Union[str, tuple, List[str], List[tuple]] = 'none', | |||
alpha: Union[float, int] = 0.8, | |||
zorder: float = 1.0, |
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.
What is the reason for using zorder=1.0
for draw_circles
but zorder=2.0
for draw_boxes
@@ -384,6 +385,7 @@ def draw_points(self, | |||
marker styles. Defaults to None. | |||
sizes (Optional[Union[np.ndarray, torch.Tensor]]): The marker size. | |||
Defaults to None. | |||
zorder (float): The z-order of points. Defaults to 1.0. |
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.
Refer to the description here(https://matplotlib.org/stable/gallery/misc/zorder_demo.html) and refine the docstring
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1049 +/- ##
=======================================
Coverage ? 76.25%
=======================================
Files ? 139
Lines ? 11074
Branches ? 2218
=======================================
Hits ? 8444
Misses ? 2272
Partials ? 358
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.
Motivation
According to Z-Order of matplotlib, lines will be in the front of circles by defaults, which results in a wrong visualization result in MMPose as follows:
I suggest adding
zorder
indraw_xxx()
functions to support customized orders.Please describe the motivation of this PR and the goal you want to achieve through this PR.
Modification
Please briefly describe what modification is made in this PR.
BC-breaking (Optional)
Does the modification introduce changes that break the backward-compatibility of the downstream repos?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.
Use cases (Optional)
If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.
Checklist