python - Equal Height subplots in matplotlib -



python - Equal Height subplots in matplotlib -

i have script generates 2 plots side side of 2 aspects of same quantity. it's long, relevant (i believe) portion. left hand plot called function "plot_shearsticks2"

depending on info i'm plotting, left hand plot may have different dimensions, 2 have same height always, , if left hand 1 wider, that's fine (and ought to). here relevant portion:

import matplotlib.pyplot plt figr = plt.figure(i,figsize=(11, 5)) fig=figr.add_subplot(121,aspect='equal') figr.subplots_adjust(wspace=0.3) shearplot = plot_shearsticks2(cat.data,[imoments[0],imoments[1],imoments[2],imoments[3],imoments[4]],scale_factor,'-k') fig=figr.add_subplot(122,aspect='equal') figr = plt.figure(i,figsize=(11, 5))

and below this, there instructions making right hand plot, nil seems indicate how tall is. tinkering options in add_subplot, doesn't seem have effect -- left hand side smaller reason. thought how create them equal heights?

i find easier ise axes funciton. example:

import pylab pl pl.figure(figsize=(4,3)) pl.axes([0.2, 0.2, 0.75, 0.35 ]) pl.axes([0.2, 0.55, 0.75, 0.35 ])

this way have ability command axis properties accurately, , partially/fully overlay 1 on other. gives important advantage on subplot function.

python matplotlib

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -