How to keep figure instead of flashing

Hi,
I am now plot two figures, The second one won't generate until I close the
first one but the second one just flash and disappear very quickly. How can
I keep both figures open until I close them myself?
Thanks

Here is my code:
    import matplotlib.pyplot as plt

   ......

    plt.figure() # ROC
    plt.plot(FPRs,TPRs)
    plt.xlabel('FP rate')
    plt.ylabel('TP rate')
    plt.title('ROC')
    plt.grid(True)
    plt.show()

    plt.figure() # histograms of scores for ESE and for decoys
    (bins, n) = histOutline.histOutline(ESE_scores)
    plt.plot(bins, n/sum(n), 'r-')
    (bins, n) = histOutline.histOutline(decoy_scores)
    plt.plot(bins, n/sum(n), 'b-')
    plt.title('Histogram of Scores')
    plt.legend(('ESE','decoy'))
    plt.show()

···

--
View this message in context: http://www.nabble.com/How-to-keep-figure-instead-of-flashing-tp22175200p22175200.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Delete your first call to show(). You only should call show() once, after you generate all of your figures.

Ryan

···

On Mon, Feb 23, 2009 at 9:33 PM, lehe <timlee126@…9…> wrote:

Hi,

I am now plot two figures, The second one won’t generate until I close the

first one but the second one just flash and disappear very quickly. How can

I keep both figures open until I close them myself?

Thanks

Here is my code:

import matplotlib.pyplot as plt

plt.figure() # ROC

plt.plot(FPRs,TPRs)

plt.xlabel('FP rate')

plt.ylabel('TP rate')

plt.title('ROC')

plt.grid(True)

plt.show()



plt.figure() # histograms of scores for ESE and for decoys

(bins, n) = histOutline.histOutline(ESE_scores)

plt.plot(bins, n/sum(n), 'r-')

(bins, n) = histOutline.histOutline(decoy_scores)

plt.plot(bins, n/sum(n), 'b-')

plt.title('Histogram of Scores')

plt.legend(('ESE','decoy'))

plt.show()


Ryan May
Graduate Research Assistant

School of Meteorology
University of Oklahoma
Sent from: Norman Oklahoma United States.