Wie stylen Sie Größe und Farbe von Matplotlib Suptitle?Python

Python-Programme
Anonymous
 Wie stylen Sie Größe und Farbe von Matplotlib Suptitle?

Post by Anonymous »

Dies sollte unkompliziert sein: Ich möchte die Matplotlib -Suptitle .
Dokumentation stylen, sagt, dass FontProperties ein Diktieren von Schrifteigenschaften ist, die als Parameter geliefert werden können.

Code: Select all

import matplotlib.pyplot as plt
import matplotlib as mpl

fig, ax = plt.subplots()
ax.set_xlim(0, 1)
fdct = {'color': 'r', 'fontsize': 32}
# Generates error
fig.suptitle('A title', fontproperties=fdct)
# Works
fig.suptitle('A title', fontsize=32)
< /code>
Der erste Befehl generiert < /p>
TypeError: FontProperties.__init__() got an unexpected keyword argument 'color'

Aber warum? Ich möchte Suptitle mit einem Diktieren von Schriftarten stylen, wie ich für andere Textinstanzen .

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post