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

pandas.Series.plot ignores color in **kwarg #1711

Closed
mcobzarenco opened this issue Jul 31, 2012 · 3 comments
Closed

pandas.Series.plot ignores color in **kwarg #1711

mcobzarenco opened this issue Jul 31, 2012 · 3 comments
Labels
Milestone

Comments

@mcobzarenco
Copy link

E.g.:

pandas.Series(randn(10)).plot(color='red')

Whose output is:

Series Plot

This used to work correctly in pandas 0.7.2

@lodagro
Copy link
Contributor

lodagro commented Jul 31, 2012

The mailing list has a related topic: https://groups.google.com/forum/?fromgroups#!topic/pydata/AMKPFPvNgcE
Looking at the code it is clear that a series will always be plotted in blue unless the color is specified in the style argument.

pandas.Series(randn(10)).plot(style='red')

series plot

@changhiskhan
Copy link
Contributor

That is indeed a bug.
For now you can use style='r'. We'll update this issue once we put in a fix. Thanks.

On Jul 31, 2012, at 8:32 PM, Marius reply@reply.github.com wrote:

E.g.:

pandas.Series(randn(10)).plot(color='red')

Whose output is:

Series Plot

This used to work correctly in pandas 0.7.2


Reply to this email directly or view it on GitHub:
#1711

@lodagro
Copy link
Contributor

lodagro commented Aug 7, 2012

I fixed this in my view.
The example below now behaves as expected:

In [28]: df = pandas.DataFrame(np.random.randn(4,4), index=list('abcd'))

In [29]: df.plot(style='d--', color='g')  # green dashed lines with diamonds
Out[29]: <matplotlib.axes.AxesSubplot at 0xae729ac>

In [30]: pandas.Series(np.random.randn(10)).plot(color='g')
Out[30]: <matplotlib.axes.AxesSubplot at 0xae729ac>

I have on question though.

In [22]: close('all')

In [23]: pandas.Series(np.random.randn(10)).plot()
Out[23]: <matplotlib.axes.AxesSubplot at 0xab0a82c>

In [24]: hold(True)

In [25]: pandas.Series(np.random.randn(10)).plot()
Out[25]: <matplotlib.axes.AxesSubplot at 0xab0a82c>

This will result in a plot with two lines both blue. In other words there is no color cycling when plotting multiple Series on a single plot. This behavior is different from mpl, is this intentional?

@wesm wesm closed this as completed in bd13307 Aug 12, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants