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

Home » Public Forums » archive » Is there a simple way to describe and plot a simple geometry
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Is there a simple way to describe and plot a simple geometry [message #63516 is a reply to message #63372] Fri, 07 November 2008 05:42 Go to previous message
Wout De Nolf is currently offline  Wout De Nolf
Messages: 194
Registered: October 2008
Senior Member
On Fri, 7 Nov 2008 01:52:02 -0800 (PST), OliverS
<o.schitthelm@fz-juelich.de> wrote:

> My first idea to resolve the problem was plotting circles defined with
> USERSYM at the specified positions. But I am not happy with this
> solution because it is very difficult to get the right proportions
> between symbolsize and distance between the positions in the plot.


Well, object graphics will solve the symbol size problem (see below).
The combination of R for the Polygon data and the SIZE keyword for the
symbol will give you the correct radius (=R*size).

But if you want different colors for each symbol, I wouldn't know how
to avoid loops. Plotting filled circles with different offsets and
colors in direct graphics will be the easiest:
X=...
Y=...
n=n_elements(x)
plot, x,y,/nodata,/iso
A = FINDGEN(17) * (!PI*2/16.)
R= 0.2
X0= COS(A)*R
Y0= SIN(A)*R
col=...
for i=0,n-1 do POLYFILL, X0+X[i],Y0+Y[i], COLOR=col[i],/data



----Begin Code----

; Your data
X = (INDGEN(196)/14)*0.63 + 0.63
Y = (INDGEN(196) MOD 14)*0.63 + 0.63
xr=[0,10]
yr=[0,10]
A = FINDGEN(17) * (!PI*2/16.)
R= 0.2
X0= COS(A)*R
Y0= SIN(A)*R
color=[255,0,0]

; "Simple" object graphics pfff
oWindow = OBJ_NEW('IDLgrWindow')
oView = OBJ_NEW('IDLgrView')
oModel = OBJ_NEW('IDLgrModel')

oCircle = OBJ_NEW('IDLgrPolygon',x0,y0,color=color)
oSymbol = OBJ_NEW('IDLgrSymbol',oCircle,size=1)
oPlot =
OBJ_NEW('IDLgrPlot',x,y,xrange=xr,yrange=yr,symbol=oSymbol,l inestyle=6)
oPlot -> GetProperty, XRANGE=xr, YRANGE=yr
xrn=norm_coord(xr)
yrn=norm_coord(yr)
oPlot->SetProperty, XCOORD_CONV=xrn, YCOORD_CONV=yrn

oXAxis = OBJ_NEW('IDLgrAxis', 0, RANGE=[xr[0], xr[1]])
oXAxis -> SetProperty, XCOORD_CONV=norm_coord(xr)
oYAxis = OBJ_NEW('IDLgrAxis', 1, RANGE=[yr[0], yr[1]])
oYAxis -> SetProperty, YCOORD_CONV=norm_coord(yr)
oXAxis -> SetProperty, TICKLEN=0.005
oYAxis -> SetProperty, TICKLEN=0.005

oModel->Add,oXAxis
oModel->Add,oYAxis
oModel->Add,oPlot
oView->Add, oModel
SET_VIEW, oView, oWindow
oWindow->draw, oView

oHolder = OBJ_NEW('IDL_Container')
oHolder->Add,oWindow
oHolder->Add,oView
oHolder->Add,oCircle
oHolder->Add,oSymbol
;obj_destroy,oHolder

----End Code----
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: How to add several *.fit files (matrices) into one output *.fit file?
Next Topic: solving equation consisting of points - sort of...

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

Current Time: Wed Oct 08 17:52:02 PDT 2025

Total time taken to generate the page: 0.00642 seconds