Skip to content

axes.errorbar doesn't follow property cycle #9922

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
as691454 opened this issue Dec 4, 2017 · 1 comment
Closed

axes.errorbar doesn't follow property cycle #9922

as691454 opened this issue Dec 4, 2017 · 1 comment
Milestone

Comments

@as691454
Copy link
Contributor

as691454 commented Dec 4, 2017

Bug report

Bug summary
Processing default fmt='' named parameter, errorbar falls back to rcParams linestyle
If property cycle includes dotted or dashed lines they are ignored

Code for reproduction

import matplotlib.pyplot as plt
plt.rc("axes", prop_cycle = 'cycler(linestyle=["-","--",":"])'
plt.errorbar(x=[1,3,4],y=[1,2,3],yerr=0.5)
plt.errorbar(x=[1,3,4],y=[0,1,2],yerr=0.5)
plt.show()

Actual outcome
all lines are solid

Possible solution is to start with an empty dictionary if fmt parameter is an empty line
instead of lines 2880-2882 in axes/_axes.py put the following

        if fmt=='':
            fmt_style_kwargs={}
        else:
            fmt_style_kwargs = {k: v for k, v in
                            zip(('linestyle', 'marker', 'color'),
                                _process_plot_format(fmt)) if v is not None}

Because code queries the property cycle, I assume it was intended to pick up the values, not override them after processing an empty fmt line.
Matplotlib version

  • Operating system: Windows 10
  • Matplotlib version: 2.1.0
  • Matplotlib backend (print(matplotlib.get_backend())): module://ipykernel.pylab.backend_inline
  • Python version: 3.6.2
  • Jupyter version (if applicable): 5.2.2
  • Other libraries:

WinPython

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

No branches or pull requests

3 participants