Search code examples
pythonpandasmatplotlibscatter-matrixfigsize

Matplotlib plotsize- Size not changing


The size of the of this plot is coming out to be <Figure size 864x432 with 0 Axes>

plt.figure(figsize =(12,6))
pd.plotting.scatter_matrix(Effect_Wf_f)
plt.show()
  1. Why is it not changing? -- despite writing before the plotting code.
  2. Is sns.set_style('whitegrid`) could be problem?

Solution

  • It could be that the plot size is changed by the plotting function. Add at the end:

    plt.gcf().set_size_inches(12,6)
    

    There is also a figsize parameter in pandas.plotting.scatter_matrix