python - Position 5 subplots in Matplotlib -



python - Position 5 subplots in Matplotlib -

i position 5 subplots such there 3 of top , 2 @ bottom next each other. current code gets close final result next (ignore grayness lines):

import matplotlib.pyplot plt ax1 = plt.subplot(231) ax2 = plt.subplot(232) ax3 = plt.subplot(233) ax4 = plt.subplot(234) ax5 = plt.subplot(236) plt.show()

you can utilize colspan when utilize suplot2grid instead of subplot.

import matplotlib.pyplot plt ax1 = plt.subplot2grid(shape=(2,6), loc=(0,0), colspan=2) ax2 = plt.subplot2grid((2,6), (0,2), colspan=2) ax3 = plt.subplot2grid((2,6), (0,4), colspan=2) ax4 = plt.subplot2grid((2,6), (1,1), colspan=2) ax5 = plt.subplot2grid((2,6), (1,3), colspan=2)

and every subplot needs 2 cols wide, subplots in sec row can shifted 1 column.

python matplotlib

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -