Slowdown in Canvas draw

Hi, I experience a slowdown in the command canvas.draw(). I

    > am drawing a moving bargraph by shifting the x-axis and
    > adding a new bar. The new bargraph is added every second,
    > but starts to slows down after 5 minutes.

    > I monitored the time it takes to execute the canvas.draw()
    > command and this increases from 200ms to over 1 second
    > within the 5 minutes and therfore the delay since I am
    > trying to display the new bar every second.

    > Any help appreciated! Thnaks Leon

Could you post your code, or at least the core of it that does the
drawing update?

JDH

I cannot give you everything, but here is the main part....

  g_canvas = get_current_fig_manager().canvas

  < SNIP >

  # Build stacked bargraph
  for jin range(data[....])
    # Select axes to add BAR too...
    axes(g_display[j]['axes']['handle'])
        b = bar(delta_time, h, 1, g_display[j]['offset'], color)
         g_display[j]['offset'] += h # build stacked bar
    # setup legend names & colors
             g_display[j]['bars'].append(b)
             g_display[j]['legend'].append(data['legend'])

  < SNIP >

  # Select axes to update...
  axes(g_display[j]['axes']['handle'])
       g_display[j]['maxy'] = Search_YMax(g_display[j]['maxy'], g_display[j]['offset'])
       g_display[j]['y-scale'] = Scale_YMax(g_display[j]['maxy'][0])
       g_display[j]['axes']['handle'].set_ylim([0, g_display[j]['y-scale']])
       g_display[j]['axes']['handle'].set_xlim([x_start, x_end])
       legend(g_display[j]['bars'], g_display[j]['legend'], 'lower left')
       ylabel(g_display[j]['unit'], g_font['unit'])
       g_canvas.draw()

Does this help?
Should I tell the axes to "not remember" the out-of-view data?

Thanks for your quick reply!
Cheers
Leon

···

On Tue, 25 May 2004 08:38:40 -0500, John Hunter <jdhunter@...5...> wrote:

    > Hi, I experience a slowdown in the command canvas.draw(). I
    > am drawing a moving bargraph by shifting the x-axis and
    > adding a new bar. The new bargraph is added every second,
    > but starts to slows down after 5 minutes.

    > I monitored the time it takes to execute the canvas.draw()
    > command and this increases from 200ms to over 1 second
    > within the 5 minutes and therfore the delay since I am
    > trying to display the new bar every second.

    > Any help appreciated! Thnaks Leon

Could you post your code, or at least the core of it that does the
drawing update?

JDH

--

Leon J. Brits
Netronome Systems (Pty) Ltd.
Tel:+27(0)12-6673650
Fax:+27(0)12-6673635