Re: plot colored ellipses [message #79656] |
Sun, 25 March 2012 15:56  |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
On Sunday, March 25, 2012 12:14:56 AM UTC-4, bing999 wrote:
> Could you please tell me where I should start to make such image?
> because I am not very used to make pretty images in IDL... :)
I might try drawing the ellipse with tvellipse.pro
( http://idlastro.gsfc.nasa.gov/ftp/pro/tv/tvellipse.pro )
with the /fill keyword. TVELLIPSE lets one specify the orientation and color of each ellipse. While one can't fill the ellipses with color gradient, it might be sufficient for you to draw concentric ellipses with inner one having the brighter color. Here is a test example:
pro test
plot,indgen(100),/nodata
x = [10,40,80]
y = [20,70,60]
orient = [80,140,0]
for i =0,2 do begin
;outer ellipse in dark red
tvellipse,12,6,x[i],y[i],orient[i],color='red7',/fill
;inner ellipse in bright red
tvellipse,8,4,x[i],y[i],orient[i],color='red4' ,/fill
endfor
return
end
--Wayne
P.S. I recently had to draw about 20 overlapping filled polygons, and ensure that each polygon could be seen. The direct graphics POLYFILL procedure does not have a transparency capability (though for the case of two polygons one can fake this using the Z buffer (e.g.
http://www.idlcoyote.com/fileio_tips/transparent.html ). In function graphics, the POLYGON() function handles transparency beautifully (if slowly), but I became frustrated by the quirks of function graphics, especially when plotting into a WIDGET_WINDOW. I finally realized by plotting the polygons in direct graphics from largest to smallest, I could (mostly) ensure that all the polygons would be visible. It is not as nice true transparency but was sufficient for my needs.
|
|
|