Answers for "python matplotlib plot add sub title"

4

matplotlib subplots title

fig.suptitle('This is a somewhat long figure title', fontsize=16)
Posted by: Guest on April-05-2020
0

how to add subtitle matplotlib

import pandas as pd
import matplotlib.pyplot as plt

d = {'series a' : pd.Series([1., 2., 3.], index=['a', 'b', 'c']),
      'series b' : pd.Series([1., 2., 3., 4.], index=['a', 'b', 'c', 'd'])}
df = pd.DataFrame(d)

title_string = "This is the title"
subtitle_string = "This is the subtitle"

plt.figure()
df.plot(kind='bar')
plt.suptitle(title_string, y=1.05, fontsize=18)
plt.title(subtitle_string, fontsize=10)
Posted by: Guest on June-25-2020

Python Answers by Framework

Browse Popular Code Answers by Language