Skip to content

DataFrame.plot(subplots=True) forces black-and-white mode regardless of other settings #11536

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
dniku opened this issue Nov 7, 2015 · 2 comments
Labels

Comments

@dniku
Copy link

dniku commented Nov 7, 2015

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd

df = pd.DataFrame(np.random.randn(6, 4), index=pd.date_range('20150101', periods=6), columns=list('ABCD'))

plotters = [
    "df.plot()",
    "df.plot(legend=None)",
    "df.plot(legend=None, subplots=True, layout=(2, 2))",
    "df['A'].plot(legend=None)",
    "df['A'].plot(legend=None, subplots=True)"
]

for i, plotter in enumerate(plotters, 1):
    eval(plotter)
    plt.title(plotter)
    plt.savefig('%d.png' % i)
    plt.close('all')

Also, notice how the title is broken in the third image.

1

2

3

4

5

@sinhrks
Copy link
Member

sinhrks commented Nov 7, 2015

Thanks for the report.

This should be fixed in 0.17.0 (#9894). Otherwise reopen attaching pd.show_versions.

@sinhrks sinhrks closed this as completed Nov 7, 2015
@sinhrks sinhrks added the Visualization plotting label Nov 7, 2015
@dniku
Copy link
Author

dniku commented Nov 7, 2015

I have indeed been running this under Pandas 0.16.2, and I have forgotten to search for existing reports before submitting my own. Thank you for taking time to point me to the fact that the problem has already been fixed.

There is still, however, a problem in the third plot. It looks like the title is associated by default with an axis, which is the bottom-right axis in this case. @sinhrks, do you think I should submit another report specifically on that?

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

2 participants