comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Slow object graphics when plotting multiple lines
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Slow object graphics when plotting multiple lines [message #92962 is a reply to message #92954] Mon, 04 April 2016 01:56 Go to previous messageGo to previous message
greg.addr is currently offline  greg.addr
Messages: 160
Registered: May 2007
Senior Member
On Friday, April 1, 2016 at 2:51:49 PM UTC+2, steve...@metoffice.gov.uk wrote:
> I am new to object graphics and struggling to speed up a simple plot that contains multiple lines.
>
> Here is an example that plots 200 lines - the object graphics version is very slow compared to the direct graphics version.
>
> ;create some dummy data
> x = replicate(0.,11,200)
> y = x
> FOR i=0,199 DO x[*,i] = FINDGEN(11)
> FOR i=0,199 DO y[*,i] = RANDOMN(seed,11)
>
> ;plot in direct graphics
> plot,[0,10],[-5,5],/nodata,yrange=[-5,5],ystyle=1
> FOR i=0,199 DO oplot,x[*,i],y[*,i]
>
> ;plot in object graphics
> w = window()
> w.REFRESH, /DISABLE
> p = plot([0,10],[-5,5],/nodata,yrange=[-5,5],/current)
> FOR i=0,199 DO !NULL=plot(x[*,i],y[*,i],/overplot)
> w.REFRESH
>
>
> Is there any way to speed this up in object graphics?
>
> Thanks
>
> Steve

You probably mean 'function graphics' - 'object graphics' is a different system. I think the extra time is the price you pay for being able to resize, zoom, rotate etc with your results.

I've been using a home-baked system for anti-aliasing direct graphics since before FG. It comes out intermediate between DG and FG:

pro test1
;create some dummy data
x = replicate(0.,11,200)
y = x
FOR i=0,199 DO x[*,i] = FINDGEN(11)
FOR i=0,199 DO y[*,i] = RANDOMN(seed,11)

;plot in direct graphics
tic
plot,[0,10],[-5,5],/nodata,yrange=[-5,5],ystyle=1
FOR i=0,199 DO oplot,x[*,i],y[*,i]
toc

;plot in object graphics
tic
w = window()
w.REFRESH, /DISABLE
p = plot([0,10],[-5,5],/nodata,yrange=[-5,5],/current)
FOR i=0,199 DO !NULL=plot(x[*,i],y[*,i],/overplot)
w.REFRESH
toc

;plot in gmwindow
tic
gmw=obj_new("gmwindow")
gmw->plot,[0,10],[-5,5],/nodata,yrange=[-5,5],ystyle=1
FOR i=0,199 DO gmw->oplot,x[*,i],y[*,i],/no_draw
gmw->draw
toc

end

IDL> test1
% Time elapsed: 0.094000101 seconds.
% Time elapsed: 3.6379998 seconds.
% Time elapsed: 0.68700004 seconds.

Output of all three are here: http://hrscview.fu-berlin.de/mex4/software/idl/gmwindow/dire ct_vs_function_vs_gmwindow.png

And the gmwindow code, here: http://hrscview.fu-berlin.de/mex4/software/idl/gmwindow/

cheers,
Greg
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: JSON file manipulation in idl
Next Topic: How to create an image with more than one gaussian psfs?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:57:16 PDT 2025

Total time taken to generate the page: 0.00498 seconds