Changing tick font after setting format

Hi, I am trying to change the font of the ticks after a line of code like this:

Is there a way I can keep the same format but change the font?
I tried plt.setp(ax.get_ymajorticklabels(), family=‘cursive’) but that didn’t work.
Any information is helpful, thank you!