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

Scatterplot - axes.color_cycle is deprecated and replaced with axes.prop_cycle #92

Open
glennzw opened this issue Dec 21, 2015 · 1 comment

Comments

@glennzw
Copy link

glennzw commented Dec 21, 2015

When running the default scatter plot the following error is generated:

/usr/local/lib/python2.7/dist-packages/matplotlib/__init__.py:872: UserWarning: axes.color_cycle is deprecated and replaced with axes.prop_cycle; please use the latter.
  warnings.warn(self.msg_depr % (key, alt_key))
Traceback (most recent call last):
  File "scatter.py", line 13, in <module>
    ppl.scatter(ax, x, y, label=str(i))
  File "/usr/local/lib/python2.7/dist-packages/prettyplotlib/colors.py", line 35, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/prettyplotlib/_scatter.py", line 24, in scatter
    color_cycle = ax._get_lines.color_cycle
AttributeError: '_process_plot_var_args' object has no attribute 'color_cycle'

The code to recreate:

import prettyplotlib as ppl
import numpy as np

fig, ax = ppl.subplots()

# Set the random seed for consistency
np.random.seed(12)

# Show the whole color range
for i in range(8):
    x = np.random.normal(loc=i, size=1000)
    y = np.random.normal(loc=i, size=1000)
    ppl.scatter(ax, x, y, label=str(i))

ppl.legend()

ax.set_title('prettyplotlib `scatter` example\nshowing default color cycle and scatter params')
fig.savefig('scatter_prettyplotlib_default.png')

Tried modifying _scatter.py with s/ax._get_lines.color_cycle/ax._get_lines.prop_cycler/ (the closest named method I could see in the _ax.get_lines object) but this didn't help. Before I dig deeper maybe you have some better ideas.

@olgabot
Copy link
Owner

olgabot commented Feb 11, 2016

Thank you for your bug report! If you have a pull request, I will accept it. However, I am no longer maintaining this package.

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

2 participants