I have plotted a stack of 9 plots and have labeled the y axis. The plots are fine but the label on the y axis is not aligned properly. When I try the following code
plt.set_ylabel('CF (E-14 )',size=15)
plt.yaxis.get_label().set_verticalalignment("baseline")
this is the error i get
AttributeError Traceback (most recent call last)
<ipython-input-140-87dca852bea2> in <module>()
100
101
--> 102 fit_data()
<ipython-input-140-87dca852bea2> in fit_data()
86
87 plt.xlabel('M0',size=15)
---> 88 plt.set_ylabel('CF (E-14 )',size=15)
89 plt.yaxis.get_label().set_verticalalignment("baseline")
90
AttributeError: module 'matplotlib.pyplot' has no attribute 'set_ylabel'
I want to align the label on the y axis. All the stacked plots have a common x axis. This is a sample plot image that I need to plot sample. This was done by someone else on another software. I am plotting it on jupyter-notebook. I am not sure how to align the label on the y-axis
If set label is not used, the label for the y axis in below the plots.
I have modified the code and this is the how it appears.
plt.xlabel('M0',size=15)
plt.ylabel('label for y axisCF(E-14)',size=15,va='center', rotation='vertical')
OR
plt.xlabel('M0',size=15)
plt.ylabel('label for y axisCF(E-14)',size=15,va='center', rotation='vertical')
plt.text(0.04, 0.5, 'common Y', va='center', rotation='vertical')
Both the codes give the same output.