5

I'm currently using Pandas direct plot (df.plot) in Python 2.7. It has worked great except it leaves me with a gray background. Is it possible to modify this color (eg. set it to white?)

Thanks.

1 Answer 1

6

Sure

You can use the ax object the plot function returns.

my_df = pd.DataFrame({'A': range(0, 100), 'B': np.random.uniform(1, 100, 100)})
ax = my_df.plot(kind='scatter', x='A', y='B')
ax.set_facecolor('black')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.