You can use a dictionary to store your options as below:
font_options = dict(ha='center', labelpad=28)
ax1.set_ylabel('Label1', **font_options)
...
ax2.set_ylabel('Label2', **font_options)
The **font_options
argument will unpack each of the key-value pairs in the dictionary and apply them within the ylabel
function.
Similarly for the ylim
option you can store your limits in a variable such as:
ylimit = 0
ylim(ylimit,)