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

Home » Public Forums » archive » Re: IDL 8.0; difficulties with "New Graphics"
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: IDL 8.0; difficulties with "New Graphics" [message #72517] Mon, 20 September 2010 09:35
Paul[3] is currently offline  Paul[3]
Messages: 18
Registered: September 2010
Junior Member
Pauolo Penteado - fortunately, the image is not too complicated that
way (~6000 vertices). It does have a fair amount of objects though
(100 plot objects).

joseandres - the refresh method worked beautifully. Thanks for
pointing me to that! I also like how you used the new !null variable
type in your code, too. If you're not interested in interactivity,
that's a bit simpler than making a list of objects to contain all the
plot objects you plan to draw. Thanks for taking the time to send that
code snippet.
Re: IDL 8.0; difficulties with "New Graphics" [message #72521 is a reply to message #72517] Fri, 17 September 2010 13:12 Go to previous message
joseandres is currently offline  joseandres
Messages: 2
Registered: September 2010
Junior Member
You should try to use the REFRESH method: "The Refresh method enables
and disables the refresh (drawing) of the graphics window. This method
is useful if you are doing a large number of graphics updates and you
do not want to see the intermediate steps."

Compare these two versions:

;;; Slow version
b = barplot(/test)
for i=0, 20 do begin
color = [randomu(seed,1)*255, randomu(seed,1)*255, randomu(seed,
1)*255]
!null = barplot(/test, /overplot, transparency=50, color=color,
fill_color=color)
endfor


;;; Faster version
b = barplot(/test)
b.refresh, /DISABLE ; Disable re-draws.
for i=0, 20 do begin
color = [randomu(seed,1)*255, randomu(seed,1)*255, randomu(seed,
1)*255]
!null = barplot(/test, /overplot, transparency=50, color=color,
fill_color=color)
endfor
b.refresh ; Re-enable drawing and show the results.


-joseandres
Re: IDL 8.0; difficulties with "New Graphics" [message #72532 is a reply to message #72521] Thu, 16 September 2010 16:59 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Sep 16, 8:38 pm, Paul <paulsta...@gmail.com> wrote:
> I'm trying to convert procedures from Direct Graphics (DG) to "New
> Graphics" (NG). I'd really like to get it working well. Can any body
> help with these hang ups?
> -on a linux node (strictly software rendering), NG is so slow that I
> opted to take the time to install IDL on the windows machine here
> -on this PC (Dual core, 2.7 GhZ, 3 GB Ram, Intel onboard
> graphics...ick), things work alright until I put more than a couple
> dozen objects (four plots, eight curve per plot) in a window, at which
> time subsequent objects are rendered progressively slower.
> -rendering in a buffer doesn't seem to speed things up at all
> -saving to .pdf or .eps after rendering is sketchy in windows. I get a
> little note from Mesa about a buffer and not having enough memory.
> Sometimes it saves just fine. (~100 kb file from a 325 px by 500 px
> window)
> -windows in NG can only be specified in pixels, and positions cannot
> be determined in 'inches', except perhaps indirectly using normal
> coordinates and choosing your width and height upon saving. However
> the save method so far seems to disregard width and height information
> when saving to eps, and if it didn't, you'd still lose your quasi-
> WYSIWYG benefit to NG.
> The new features entice me to use it, but the slowness and lack of
> layout control steer me away. Suggestions?
> Cheers.

Do your plots have many vertices (typically, more than some hundred
thousand)? Any flavor of object graphics is going to be slow with
complicated object (or with many objects), since they have to keep all
of those objects around (which is what allows for editing). Currently,
the only use I still make of direct graphics is for those situations
where I can have hundreds of thousands of elements being plotted.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Renaming tags in an array of structures
Next Topic: half-point thickness

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

Current Time: Wed Oct 08 11:44:55 PDT 2025

Total time taken to generate the page: 0.00377 seconds