Skip to content
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

Switch from color_cycle to prop_cycle in tomography plotting tools #150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ihincks
Copy link
Collaborator

@ihincks ihincks commented Feb 8, 2019

This was a name change in matplotlib 1.5 of the default color cycle, and the old name is now deprecated.

This PR addresses QInfer/qinfer-examples#4 (comment)

this was a name change in matplotlib 1.5, and the old name is now deprecated
@scasagrande
Copy link
Collaborator

This matplotlib>=1.5 requirement should be listed somewhere in the project. A good place might be under optional requirements in setup.py

@ihincks
Copy link
Collaborator Author

ihincks commented Feb 8, 2019

Hmm, it's not actually a requirement; it's imported in try blocks. Maybe we should check the version inside the try block and raise if < 1.5.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 75.631% when pulling 397c98b on fix-color_cycle into 8170c84 on master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 75.631% when pulling 397c98b on fix-color_cycle into 8170c84 on master.

@scasagrande
Copy link
Collaborator

scasagrande commented Feb 8, 2019

Right, but matplotlib is an optional requirement and can be listed as such.

I also imagine it should be listed in the docs somewhere.

Actually, checking just now the matplotlib website, 2.2.x is the LTS dual py2/3 release. It appears that 1.5 was the last 1.x release, which is no longer supported. I'd probably still put a check in somewhere, but you might not need to put it in the docs.

@scasagrande
Copy link
Collaborator

I checked travis, its reporting failures on doctest for both 2.7 and 3.5

3.5: Could not import extension matplotlib.sphinxext.only_directives, which was apparently removed in matplotlib 3 matplotlib/matplotlib#11295

2.7: ImportError: cannot import name l_ caused at conf.py#L18

@mikedeltalima
Copy link

I tried this, but the cycler can't be indexed

line 177, in plot_rebit_prior
    c=pallette[0],
ValueError: Can only use slices with Cycler.__getitem__

Maybe something like pallette = [x['color'] for x in plt.rcParams['axes.prop_cycle']] instead?

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.

4 participants