On Wednesday, June 3, 2015 at 12:26:34 PM UTC+2, g.na...@gmail.com wrote:
> Actually I used write_gif before. But I had only one image. Now I need to overplot the vectors on top of the image that's why I didn't manage to do that.
It's a bit tricky, but all the info is out there. Below is a working solution to make a series of gifs with rotating arrow arrow:
pro testGifOut
xSize = 400
ySize = 400
window, xsize=xSize, ysize=ySize, /free
tvscl, bytscl(sin(dist(xSize)))
xPos = cos(!pi*2.0*findgen(11)/10.0)
yPos = sin(!pi*2.0*findgen(11)/10.0)
cgArrow, 0.5, 0.5, 0.3*xPos[0]+0.5, 0.3*yPos[0]+0.5, /Solid, /normal, thick=4, color='red'
inImg = tvrd(0, 0, xSize, ySize, /True)
image2D = color_quan(inImg, 1, r, g, b, Colors=256)
write_gif, 'testGif.gif', image2D, r, g, b, /multiple, repeat_count=0, delay_time=20
for i=1,10 do begin
tvscl, bytscl(sin(dist(xSize)*i*0.1))
cgArrow, 0.5, 0.5, 0.3*xPos[i]+0.5, 0.3*yPos[i]+0.5, /Solid, /normal, thick=4, color='red'
inImg = tvrd(0, 0, xSize, ySize, /True)
image2D = color_quan(inImg, 1, r, g, b, Colors=256)
write_gif, 'testGif.gif', image2D, r, g, b, /multiple, repeat_count=0, delay_time=20
endfor
write_gif, 'testGif.gif', image2D, /close
end
Hope it helps,
Helder
|