Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You could put your plots in a list or matrix, iterate to get their dimensions, compute the max and min values for the y axis in all the plots and draw together the plots using graphics_array. As a proof of concept, consider the following example:

p = []
for i in range(3):
    plt = plot([random()*sin(x),random()*cos(x)],(x,-pi,pi), color=["red","green"])
    p.append(plt)

ym = 1e+20
yM = 1e-20
for i in range(len(p)):
    bounds = p[i].get_minmax_data()
    ym = min(ym, bounds["ymin"])
    yM = max(yM, bounds["ymax"])

graphics_array(p).show(frame=True) # each plot uses its own vertical scale
graphics_array(p).show(ymin=ym,ymax=yM, frame=True) # same scale for all plots