Skip to content

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

Closed
wants to merge 2 commits into from

Conversation

as691454
Copy link
Contributor

@as691454 as691454 commented Dec 5, 2017

…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

Copy link
Member

@phobson phobson left a 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?

@@ -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=='':
Copy link
Member

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)

Copy link
Contributor Author

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.

Copy link
Member

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?

Copy link
Contributor Author

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.

@@ -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={}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same PEP8 issue here

@jklymak
Copy link
Member

jklymak commented Dec 7, 2017

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..

http://matplotlib.org/devdocs/devel/gitwash/index.html

@jklymak jklymak closed this Dec 7, 2017
@as691454
Copy link
Contributor Author

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.

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

Successfully merging this pull request may close these issues.

3 participants