diff --git a/GPy/examples/tutorials.py b/GPy/examples/tutorials.py index 4371d7a8..5527e319 100644 --- a/GPy/examples/tutorials.py +++ b/GPy/examples/tutorials.py @@ -115,24 +115,25 @@ def tuto_kernel_overview(): # Create GP regression model m = GPy.models.GPRegression(X, Y, Kanova) - pb.figure(figsize=(5,5)) - m.plot() + fig = pb.figure(figsize=(5,5)) + ax = fig.add_subplot(111) + m.plot(ax=ax) pb.figure(figsize=(20,3)) pb.subplots_adjust(wspace=0.5) - pb.subplot(1,5,1) - m.plot() + axs = pb.subplot(1,5,1) + m.plot(ax=axs) pb.subplot(1,5,2) pb.ylabel("= ",rotation='horizontal',fontsize='30') - pb.subplot(1,5,3) - m.plot(which_parts=[False,True,False,False]) + axs = pb.subplot(1,5,3) + m.plot(ax=axs, which_parts=[False,True,False,False]) pb.ylabel("cst +",rotation='horizontal',fontsize='30') - pb.subplot(1,5,4) - m.plot(which_parts=[False,False,True,False]) + axs = pb.subplot(1,5,4) + m.plot(ax=axs, which_parts=[False,False,True,False]) pb.ylabel("+ ",rotation='horizontal',fontsize='30') - pb.subplot(1,5,5) + axs = pb.subplot(1,5,5) pb.ylabel("+ ",rotation='horizontal',fontsize='30') - m.plot(which_parts=[False,False,False,True]) + m.plot(ax=axs, which_parts=[False,False,False,True]) return(m) diff --git a/doc/tuto_kernel_overview.rst b/doc/tuto_kernel_overview.rst index 6cc7b30d..450e53e2 100644 --- a/doc/tuto_kernel_overview.rst +++ b/doc/tuto_kernel_overview.rst @@ -230,19 +230,19 @@ The submodels can be represented with the option ``which_function`` of ``plot``: pb.figure(figsize=(20,3)) pb.subplots_adjust(wspace=0.5) - pb.subplot(1,5,1) - m.plot() + axs = pb.subplot(1,5,1) + m.plot(ax=axs) pb.subplot(1,5,2) pb.ylabel("= ",rotation='horizontal',fontsize='30') - pb.subplot(1,5,3) - m.plot(which_parts=[False,True,False,False]) + axs = pb.subplot(1,5,3) + m.plot(ax=axs, which_parts=[False,True,False,False]) pb.ylabel("cst +",rotation='horizontal',fontsize='30') - pb.subplot(1,5,4) - m.plot(which_parts=[False,False,True,False]) + axs = pb.subplot(1,5,4) + m.plot(ax=axs, which_parts=[False,False,True,False]) pb.ylabel("+ ",rotation='horizontal',fontsize='30') - pb.subplot(1,5,5) + axs = pb.subplot(1,5,5) pb.ylabel("+ ",rotation='horizontal',fontsize='30') - m.plot(which_parts=[False,False,False,True]) + m.plot(ax=axs, which_parts=[False,False,False,True]) .. pb.savefig('tuto_kern_overview_mANOVAdec.png',bbox_inches='tight')