Skip to content

VIS: let scatter plots obey mpl color scheme (#3338) #5060

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

Merged
merged 1 commit into from
Oct 4, 2013

Conversation

jorisvandenbossche
Copy link
Member

Closes #3338.

Fixes the remaining plot functions that don't follow the matplotlib style (functions based on scatter plots).

Rationale:

  • set the color keyword c to default one defined in matplotlibs rcParams if c was not specified by the user (because c='b' is harcoded in matplotlib scatter method).
  • the color keyword is not checked because, if specified by the user, it already is given preference by matplotlib over c if both are given.

There is a new PR on scatter based plotting methods (#3473), but I suppose that it can be handled in that PR to ensure this new plotting method also follows this approach?

@jreback
Copy link
Contributor

jreback commented Oct 2, 2013

@cpcloud ?

@cpcloud
Copy link
Member

cpcloud commented Oct 2, 2013

pulling it down now

@cpcloud
Copy link
Member

cpcloud commented Oct 3, 2013

Still get obnoxious blue:

funky-colors

@jorisvandenbossche
Copy link
Member Author

@cpcloud How did you obtain this plot?

If I do (example from the docs):

pd.options.display.mpl_style = 'default'
df = pd.DataFrame(np.random.randn(1000, 4), index=pd.date_range('1/1/2000', periods=1000), columns=list('ABCD'))
df = df.cumsum()
df.plot()

I get the new color scheme, as you also see in the docs: http://pandas.pydata.org/pandas-docs/dev/visualization.html#basic-plotting-plot

@jorisvandenbossche
Copy link
Member Author

@cpcloud Ah, it seems like you posted the plot in this part of the docs: http://pandas.pydata.org/pandas-docs/dev/visualization.html#suppressing-tick-resolution-adjustment

Well, this one is generated by explicitly stating the colors you want (df.A.plot(color='r')), so it logically follows this and not the default color scheme.

Off course, we could remove this color=.. like this:

with pd.plot_params.use('x_compat', True):
    df.A.plot()
    df.B.plot()
    df.C.plot()

to get rid of these colors in the docs, but then the purpose of the example is a little bit lost, because you could do the same with just df[['A', 'B', 'C']].plot(x_compat=True)

@jreback
Copy link
Contributor

jreback commented Oct 4, 2013

@jorisvandenbossche ready to go?

@jreback
Copy link
Contributor

jreback commented Oct 4, 2013

@cpcloud this ok?

@jorisvandenbossche
Copy link
Member Author

@jreback for me this is ready

@cpcloud
Copy link
Member

cpcloud commented Oct 4, 2013

Yep good 2 go

jreback added a commit that referenced this pull request Oct 4, 2013
VIS: let scatter plots obey mpl color scheme (#3338)
@jreback jreback merged commit bcdc98f into pandas-dev:master Oct 4, 2013
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.

Go over the rest of the plotting functions so they obey the mpl color scheme
3 participants