Topic: aplot - delay between plots

Please consider the following code snippet:
        pli = initialize_plot()
        call add_dataset(pli, vecb, sxxo)
        call add_dataset(pli, vecb, sxxi)
        call set_seriestype(pli, 0, APLOT_STYLE_LINE)
        call set_seriestype(pli, 1, APLOT_STYLE_DOT)
        call set_xlabel(pli, "normalized magnetic field b")
        call set_ylabel(pli, "normalized sxx")
        call set_title(pli, "input - points, result - line")
        call display_plot(pli)
        call destroy_plot(pli)
        ! sxy
        plo = initialize_plot()
        call add_dataset(plo, vecb, sxyo)
        call add_dataset(plo, vecb, sxyi)
        call set_seriestype(plo, 0, APLOT_STYLE_LINE)
        call set_seriestype(plo, 1, APLOT_STYLE_DOT)
        call set_xlabel(plo, "normalized magnetic field b")
        call set_ylabel(plo, "normalized sxy")
        call set_title(plo, "input - points, result - line")
        call display_plot(plo)
        call destroy_plot(plo)
When executed, only the first plot is visible. When closed, the second plot does not show up, or probably
it does, but is immediately closed. However, if some artificial delay is introduced in between, everything
works as expected. So maybe a small delay should be built-in  to destroy_plot subroutine?

Re: aplot - delay between plots


Interesting bug...  I'm not sure exactly what is happening, but there are threads involved in displaying plots.  I'm guessing there is some sort of synchronization issue that is causing the first destroy_plot to close the second as well.

Jeff Armstrong
Approximatrix, LLC