0

Any idea why my script below places the title so far from the graphs/subplots? Is it possible to specify the font size of the title?

df = pandas.read_csv('data.csv', delimiter=',', 
                             index_col=0, 
                             parse_dates=[0], dayfirst=True, 
                             names=['Date','1','2','3','4', '5'])

        df.plot(subplots=True, marker='.',markersize=8, title ="Graph", fontsize = 10, color=['r','b','b','b', 'b'], figsize=(8, 18))


        plt.savefig('capture.png')

Thanks a ton!

1
  • have you had a look here? Commented Jul 20, 2016 at 14:31

1 Answer 1

7

You'll have to use matplotlib to edit the font size, as pandas does not allow passing for font sizes or similar, unfortunately (afaik).

try this:

ax = df.plot()
ax.set_title('Graph', fontsize=20)  # or size, alternatively

Essentially, pandas.DataFrame.plot() returns a matplotlib axis object, on which you then can call any methods associated with it.

For more, check out the matplotlib documentation.

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.