-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix for axes.errorbars to enable use of line style and marker propert… #9931
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
…ies from axes.prop_cycle
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.
Thanks for the PR! Could we get a test to demonstrate that this works? Are you comfortable with writing an image comparison test?
lib/matplotlib/axes/_axes.py
Outdated
@@ -2822,7 +2822,10 @@ def errorbar(self, x, y, yerr=None, xerr=None, | |||
plot_line = (fmt.lower() != 'none') | |||
label = kwargs.pop("label", None) | |||
|
|||
fmt_style_kwargs = {k: v for k, v in | |||
if fmt=='': |
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.
the PEP8 style checker wants this to be: if fmt == ''
(spaces around the operator)
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.
Test is simple
import matplotlib.pyplot as plt
plt.rc("axes", prop_cycle = 'cycler(linestyle=["--",":"],mfc=["k","w"],marker=["s","s"])')
plt.errorbar(x=[1,3,4],y=[3,2,3],yerr=0.5)
plt.errorbar(x=[1,3,4],y=[1,0,1],yerr=0.5)
plt.show()
I am exceptionally uncomfortable with git, github and compiling matplotlib, at least on windows. I just fixed the file axes/_axes.py in my winpython installation with matplotlib 2.1.0 and it worked. I hope it will be easier to compile matplotlib on Linux. If it works I will be able to contribute in more appropriate and civilized way.
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.
Understood. Do you mind if I add a commit with a test and push to your branch later today?
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.
I don't mind anything. I thought I can save somebody's time because I've already found the solution. I do think it is very handy to be able to contribute properly instead of working around the issues, just don't have much time right now to invest in troubleshooting my development setup. It compiles and installs, but then matplotlib complains it can't find some dll. So if you have it up and running, I hope you can test my changes against the bleeding edge before adding them. Thanks for being patient with me.
lib/matplotlib/axes/_axes.py
Outdated
@@ -2822,7 +2822,10 @@ def errorbar(self, x, y, yerr=None, xerr=None, | |||
plot_line = (fmt.lower() != 'none') | |||
label = kwargs.pop("label", None) | |||
|
|||
fmt_style_kwargs = {k: v for k, v in | |||
if fmt=='': | |||
fmt_style_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.
same PEP8 issue here
This is superseded by #9952, right? If you want to keep the same PR w/ a new branch, you can rename your new branch with the old name. https://stackoverflow.com/questions/6591213/how-do-i-rename-a-local-git-branch You may need to delete the old branch locally. Then force-push back to GitHub.. |
Yes. Sorry I am being like a bull in a china shop. And thank you for getting me up to speed with version control and modern collaboration techniques. |
…ies from axes.prop_cycle
Fixes issues #9922 and #9920
It is just few lines of code, but I might have messed some tabs and spaces or such. Similar changes work with matplotlib 2.1.0. I can't test the one from master because it won't work with my WinPython as is and I can't compile Matplotlib. https://github.com/jbmohler/matplotlib-winbuild is obsolete. It demands VS2010 while Python 3.6 requires VC 2015