Seaborn graph size

Viewed 40

I am trying to plot 6 different graphs within the same figure object, but the plots are not understable, as i am getting what you can see in the picture.

time series graphs

Which attribute of fig should i change to make the labels readable, and to have a proper size such that the time series are understandable?

import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
from LoadData import *

co2_data=loadDataCO2()
GDP_data = loadDataGDP()

sns.set_style("darkgrid")
fig, ax = plt.subplots(2,3, figsize= (100,65))
fig.set_size_inches(100, 65)

fig.subplots_adjust(hspace=0.3500, wspace=0.2400)

ax[0][0].tick_params(labelrotation = 15)
sns.lineplot(x='Year', y='Annual_CO2_emissions_TperCap', data=co2_data, ax=ax[0][0])

ax[0][1].tick_params(labelrotation = 15)
sns.lineplot(x='Year', y='logAnnual_CO2_emissions_TperCap', data=co2_data, ax=ax[0][1])

ax[0][2].tick_params(labelrotation = 15)
sns.lineplot(x='Year', y='logDiffAnnual_CO2_emissions_TperCap', data=co2_data, ax=ax[0][2])

ax[1][0].tick_params(labelrotation = 15)
sns.lineplot(x='Year', y='GDP_perCap', data=GDP_data, ax=ax[1][0])

ax[1][1].tick_params(labelrotation = 15)
sns.lineplot(x='Year', y='logGDP_perCap', data=GDP_data, ax=ax[1][1])

ax[1][2].tick_params(labelrotation = 15)
sns.lineplot(x='Year', y='logDiffGDP_perCap', data=GDP_data, ax=ax[1][2])

plt.show()

I have tried with set_size_inches and figsize, but it doesnt work.

Thank you !

0 Answers
Related