Sns.lineplot(ax = axes, x=x1, y=y1,Īxes.axhline(y=0, color='red', dashes=(2, 1), zorder=0)Īxes.set_ylabel('y axis row 1', fontsize=14)Īnd here's what I'm getting out. If I set sharey=False, then all the subplots in the row respect the t(yticks=range(0,70,10)) code, but not according to the same vertical scale, not to mention that sharey=False also messes up my second row of subplots.ĭoes anyone understand why t(yticks=range(0,70,10)) is seemingly being applied only once in the loop, instead of four times? Thank you.Įdit: I can't provide data, but here's basically what my full code looks like: fig, axes = plt.subplots(2, 4, figsize=(20, 12), sharex=True, sharey='row')Īxes.tick_params(axis='both', which='major', labelsize=13)Īxes.axhline(y=50, color='k', dashes=(2, 1), zorder=0)Īxes.set_ylabel('y axis row 0', fontsize=14) This means that, despite the fact that sharey='row', axes, axes, and axes share a yaxis that is not shared by axes. The other three subplots to the left of it on the same row keep their default ytick values derived from the data (see image below). the final subplot in this row) respects the t(yticks=range(0,70,10)) line of code. View Sharex Laboratories (location in Balochistan, Pakistan, revenue, industry and description. Now when I run the code, only the subplot axes (i.e. And it worked great.until I tried to use this inside my loop to force the yaxis range of the first row: t(yticks=range(0,70,10)) It is published under the GNU General Public License. The xaxis is shared by column ( sharex='col'), the yaxis by row ( sharey='row'). ShareX is a free and open-source screenshot and screencast utility for Microsoft Windows. I wrote a for loop to create a figure with two rows and four columns. Update: If you find yourself here with a similar problem, I found a solution that worked for me (see my response below) here
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |