Skip to content

Set_color method for line2d object in latest document not work #23296

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

Closed
skywateryang opened this issue Jun 17, 2022 · 3 comments
Closed

Set_color method for line2d object in latest document not work #23296

skywateryang opened this issue Jun 17, 2022 · 3 comments
Milestone

Comments

@skywateryang
Copy link
Contributor

skywateryang commented Jun 17, 2022

Documentation Link

https://matplotlib.org/stable/gallery/pyplots/fig_axes_customize_simple.html#sphx-glr-gallery-pyplots-fig-axes-customize-simple-py

Problem

In this link I provide, I found some part of the code in latest matplotlib version not work(3.5.x). This part works for 3.2.1, but not work now, while the latest document hasn't been changed.

Code as below, as you see, here set_color method for Line2D object not work actually, with the ticklines still being black rather green
for line in ax1.yaxis.get_ticklines: line.set_color('tab:green')

Suggested improvement

Change this line from line.set_color('tab:green') to line.set_markeredgecolor("tab:green")

@tacaswell
Copy link
Member

Interesting, bisecting via the docs confirms that

https://matplotlib.org/3.2.2/gallery/pyplots/fig_axes_customize_simple.html#sphx-glr-gallery-pyplots-fig-axes-customize-simple-py is correct and https://matplotlib.org/3.3.0/gallery/pyplots/fig_axes_customize_simple.html#sphx-glr-gallery-pyplots-fig-axes-customize-simple-py is broken.

I am a bit curious the underlying change was that caused this, but it is been the new way (for what ever reason) long enough now going back to the old behavior could be more disruptive than just staying as we are.

@skywateryang If that changes makes the ticks render as green can you please open a PR with that change?

@tacaswell tacaswell added this to the v3.6.0 milestone Jun 18, 2022
@skywateryang
Copy link
Contributor Author

@tacaswell Thanks for reply.
I have tried create a PR as below.
#23300
Since this is my first time to create PR, not sure whether I did it in a correct way. Let me know if there are any problems.

@QuLogic
Copy link
Member

QuLogic commented Jun 21, 2022

Fixed by #23300.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants