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----
|