The refresh method and relative coordinate positioning [message #88624] |
Mon, 19 May 2014 12:40 |
Gordon Farquharson
Messages: 48 Registered: December 2010
|
Member |
|
|
Hi All
In the spirit of sharing knowledge about function graphics, I present the following knowledge gained after some quality hair pulling time.
A great trick when plotting large amounts of data with function graphics is to disable drawing in the window. For example,
w1 = window(DIMENSIONS=[800, 400])
w1.refresh, /DISABLE
im1 = image(findgen(1000,1000), CURRENT=w1, IMAGE_DIMENSIONS=[60,30], IMAGE_LOCATION=[25,25], AXIS_STYLE=2)
w1.refresh
Another nice feature of function graphics is relative coordinate positioning. For example, I can add a color bar to the right of the image using
cb1 = colorbar(TARGET=im1, ORIENTATION=1, TEXTPOS=1, POSITION=[1.025,0.,1.050, 1.], /RELATIVE)
However, disabling refresh and relative coordinate positioning do not play nicely together. For example, try
w1 = window(DIMENSIONS=[800, 400])
w1.refresh, /DISABLE
im1 = image(findgen(1000,1000), CURRENT=w1, IMAGE_DIMENSIONS=[60,30], IMAGE_LOCATION=[25,25], AXIS_STYLE=2)
cb1 = colorbar(TARGET=im1, ORIENTATION=1, TEXTPOS=1, POSITION=[1.025,0.,1.050, 1.], /RELATIVE)
w1.refresh
The result is not what one would expect (and rather frustrating if you try the latter first).
Gordon
|
|
|