Python Data Science Handbook: Essential Tools for Working with Data by VanderPlas Jake

Python Data Science Handbook: Essential Tools for Working with Data by VanderPlas Jake

Author:VanderPlas, Jake [VanderPlas, Jake]
Language: eng
Format: epub
Publisher: O'Reilly Media
Published: 2016-11-20T16:00:00+00:00


In [ 4 ]: for i in range ( 1 , 7 ): plt . subplot ( 2 , 3 , i ) plt . text ( 0.5 , 0.5 , str (( 2 , 3 , i )), fontsize = 18 , ha = 'center' )

Figure 4-61. A plt.subplot() example

The command plt.subplots_adjust can be used to adjust the spacing between these plots. The following code (the result of which is shown in Figure 4-62 ) uses the equivalent object-oriented command, fig.add_subplot() :

In [ 5 ]: fig = plt . figure () fig . subplots_adjust ( hspace = 0.4 , wspace = 0.4 ) for i in range ( 1 , 7 ): ax = fig . add_subplot ( 2 , 3 , i ) ax . text ( 0.5 , 0.5 , str (( 2 , 3 , i )), fontsize = 18 , ha = 'center' )



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.