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.
|
|
|
Re: plot colored ellipses [message #79660 is a reply to message #79656] |
Sun, 25 March 2012 07:59   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
bing999 writes:
> I made a simple 2D scatter plot from a square array "matrix", using
> plot, matrix,psym=3. I would like to make nice-looking images by:
> - plotting ellipses instead of points (but centered on the points
> coordinates)
> - orientate these ellipses as I want
> - use different colors for them
> - apply a color gradient to each ellipse, i.e bright red in the center
> and light at the edge
> - etc
>
> Could you please tell me where I should start to make such image?
I would start in your dreams, because I'm pretty sure
that's the only place where this is likely to happen.
It *definitely* is not going to happen in IDL direct
graphics routines. :-)
Well, I guess you could figure out how to draw and rotate
ellipses, and then load them for use with plot commands.
(See SymCat for an example of how this is done.) And, you
could certainly figure out how to make them different colors.
But there is no chance whatsoever of a color gradient. :-)
Sounds like something function graphics ought to be able to
do. ;-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: plot colored ellipses [message #79796 is a reply to message #79656] |
Thu, 29 March 2012 23:01  |
Thibault Garel
Messages: 55 Registered: October 2009
|
Member |
|
|
Hi,
thanks for your reply.
i have been able to make simple ellipse plots with the tvellipse
routine, as Wayne suggested. However, it is hard to make nice images
with this tool... Before giving a real try at function graphics, do
you think that it will really allow to make good pictures with color
gradients ? I am asking that since I never used this tool so far and
it looks much more complex than standard plot routines... :)
Would you have examples of beautiful images computed with the function
graphics?
Cheers
Dreamer
|
|
|