-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix errorbar property cycling to match plot. #17930
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
lib/matplotlib/axes/_axes.py
Outdated
base_style = next(self._get_lines.prop_cycler) | ||
|
||
base_style = self._get_lines._getdefaults( | ||
set(), {**fmt_style_kwargs, **kwargs}) |
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.
Is this where the property cycler gets implicitly advanced?
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.
Yes, I don't really like the private API of a private member, but that's how it is right now.
Is it the case that |
I think My preferred method would be to use something higher, like |
I'm not blocking on that comment - just seems if we want the two to have the same behaviour they should have the same method of getting the behaviour... |
Well, it is, sort of. I experimented a little bit with calling one of those higher methods and then
However, the main line is I think at best, we could have |
The closest I could do is call matplotlib/lib/matplotlib/axes/_base.py Line 210 in bb9d11d
or process data matplotlib/lib/matplotlib/axes/_base.py Lines 220 to 263 in bb9d11d
which are not done in errorbar .
|
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.
This looks good to me - just a small comment...
With #8031 in, I'd like to apply this to the 3D version as well before merging. |
This seems rather complete (modulo some restructuring of the clipping). IMHO it would be easier for reviewing to merge this now and do the 3D stuff in a separate PR. |
a7c085d
to
32c3ece
Compare
Sure, I ran into other issues just doing that directly, so I'll mark this Ready for Review now, and do 3D in a followup PR. Not sure what you mean about clipping though? |
Sorry, I meant popping, not clipping. |
It would not cycle if a color were specified. However, this does not match `plot`, which does not advance the cycle only if _all_ properties in the cycle are specified. Notably, this means if your property cycle was for line style, specifying a color would ignore the cycle in `errorbar`, but not in `plot`. Fixes matplotlib#7074.
Move iterable checks before working on styling. In the styling section, the lines and caps dictionary modifications are intermixed, making them a bit confusing. Also do the same marker style removal from the cap style, which would normally be replaced later.
We can't directly use `self.plot` or `self._get_lines` because they would do `self._process_unit_info` and/or *data* keyword argument processing.
32c3ece
to
da8d510
Compare
Ah, okay, the last commit should clear that up, I hope. |
As with 2D before matplotlib#17930, it would not cycle if a color were specified. However, this does not match `plot`, which does not advance the cycle only if _all_ properties in the cycle are specified. Notably, this means if your property cycle was for line style, specifying a color would ignore the cycle in `errorbar`, but not in `plot`. This is a 3D version of 149e7fb and 0782c74.
As with 2D before matplotlib#17930, it would not cycle if a color were specified. However, this does not match `plot`, which does not advance the cycle only if _all_ properties in the cycle are specified. Notably, this means if your property cycle was for line style, specifying a color would ignore the cycle in `errorbar`, but not in `plot`. This is a 3D version of 149e7fb and 0782c74.
As with 2D before matplotlib#17930, it would not cycle if a color were specified. However, this does not match `plot`, which does not advance the cycle only if _all_ properties in the cycle are specified. Notably, this means if your property cycle was for line style, specifying a color would ignore the cycle in `errorbar`, but not in `plot`. This is a 3D version of 149e7fb and 0782c74.
As with 2D before matplotlib#17930, it would not cycle if a color were specified. However, this does not match `plot`, which does not advance the cycle only if _all_ properties in the cycle are specified. Notably, this means if your property cycle was for line style, specifying a color would ignore the cycle in `errorbar`, but not in `plot`. This is a 3D version of 149e7fb and 0782c74.
As with 2D before matplotlib#17930, it would not cycle if a color were specified. However, this does not match `plot`, which does not advance the cycle only if _all_ properties in the cycle are specified. Notably, this means if your property cycle was for line style, specifying a color would ignore the cycle in `errorbar`, but not in `plot`. This is a 3D version of 149e7fb and 0782c74.
As with 2D before matplotlib#17930, it would not cycle if a color were specified. However, this does not match `plot`, which does not advance the cycle only if _all_ properties in the cycle are specified. Notably, this means if your property cycle was for line style, specifying a color would ignore the cycle in `errorbar`, but not in `plot`. This is a 3D version of 149e7fb and 0782c74.
As with 2D before matplotlib#17930, it would not cycle if a color were specified. However, this does not match `plot`, which does not advance the cycle only if _all_ properties in the cycle are specified. Notably, this means if your property cycle was for line style, specifying a color would ignore the cycle in `errorbar`, but not in `plot`. This is a 3D version of 149e7fb and 0782c74.
As with 2D before matplotlib#17930, it would not cycle if a color were specified. However, this does not match `plot`, which does not advance the cycle only if _all_ properties in the cycle are specified. Notably, this means if your property cycle was for line style, specifying a color would ignore the cycle in `errorbar`, but not in `plot`. This is a 3D version of 149e7fb and 0782c74.
As with 2D before matplotlib#17930, it would not cycle if a color were specified. However, this does not match `plot`, which does not advance the cycle only if _all_ properties in the cycle are specified. Notably, this means if your property cycle was for line style, specifying a color would ignore the cycle in `errorbar`, but not in `plot`. This is a 3D version of 149e7fb and 0782c74.
PR Summary
It would not cycle if a
color
were specified. However, this does not matchplot
, which does not advance the cycle only if all properties in the cycle are specified. Notably, this means if your property cycle was for line style, specifying acolor
would ignore the cycle inerrorbar
, but not inplot
.Fixes #7074.
PR Checklist