skip to Main Content

Visual Studio Code – matplotlib 'plt.tight_layout()' function not working

I have the following code: listofmodels = [resultmodeldistancearlylife,resultmodeldurationearlylife,resultmodeldistancenavigate,resultmodeldurationnavigate,resultmodeldistancetravel,resultmodeldurationtravel,resultmodeldistancevideo,resultmodeldurationvideo,resultmodeldistancelifestyle,resultmodeldurationlifestyle,resultmodeldistancegrow,resultmodeldurationgrow,resultmodeldistancesleep,resultmodeldurationsleep,resultmodeldistancedemographics,resultmodeldurationdemographics] names = ['resultmodeldistancearlylife','resultmodeldurationearlylife','resultmodeldistancenavigate','resultmodeldurationnavigate','resultmodeldistancetravel','resultmodeldurationtravel','resultmodeldistancevideo','resultmodeldurationvideo','resultmodeldistancelifestyle','resultmodeldurationlifestyle','resultmodeldistancegrow','resultmodeldurationgrow','resultmodeldistancesleep','resultmodeldurationsleep','resultmodeldistancedemographics','resultmodeldurationdemographics'] for i in range(len(listofmodels)): fig, axes = plt.subplots(nrows=2, ncols=2) plt.tight_layout() plt.title(names[i],loc='left') sns.residplot(listofmodels[i].predict(), y, lowess=True, scatter_kws={'alpha': 0.5}, line_kws={'color':'red'}, ax=axes[0,0]) axes[0,0].title.set_text('Residuals vs Fitted Linearity Plot') axes[0,0].set(xlabel='Fitted', ylabel='Residuals') sm.ProbPlot(listofmodels[i].resid).qqplot(line='s', color='#1f77b4', ax=axes[1,0]) axes[1,0].title.set_text('QQ…

VIEW QUESTION

Ubuntu – R plot font issue

Trying to plot a histogram in R 4.2.0, the fonts are not shown properly Searching online couldn't find anything useful. Any hint, what is missing? > sessionInfo() R version 4.2.0 (2022-04-22) Platform: x86_64-conda-linux-gnu (64-bit) Running under: Ubuntu 20.04.3 LTS Matrix…

VIEW QUESTION
Back To Top
Search