two scale plots

John,

I am still trying to get the two scale plot to share the same x axis.

my last attempt was to do this:

ax1 = subplot(111)
        n0,b0,p0 = hist(qtiltheta[i], 100,normed=1)
        ax1.yaxis.tick_left()
        title(titles[i])
        ax2 = subplot(111,frameon=False)
                n1,b1,p1 = hist(q1theta[i],100,normed=1)
        set(p1,'facecolor','r','alpha',0.6)
        legend((p0[0],p1[0]),('Posterior','Prior'))
        **ax2.set_xlim(ax1.get_xlim())**

but this approach did not have the expected outcome but a weird oucome that can’t easily be described in words.

how do I force the second plot to have the same limits on the x axis as the first?
fiocruz4.jpg
Flávio Codeço Coelho, PhD

Programa de Computação Científica

Fundação Oswaldo Cruz

Rio de Janeiro – Brasil

···