How to use the current date as the title of the chart

Hello,
How do I use the current date as the title of the chart.
Thanks.

How do I use the current date as the title of the chart.

I’d use .set_title and get the current date like this (interactive
example):

 >>> from datetime import datetime
 >>> str(datetime.now())
 '2023-09-06 09:17:37.268343'

Of course that’s a little ugly. A datetime ibjecthas astrptime`
method which would let you format a string with just the bits you want.

···

On 03Sep2023 17:11, Jim Julian via Matplotlib nobody@discourse.matplotlib.org wrote:

1 Like