getting an IDLgrPlot drawn [message #51488] |
Fri, 24 November 2006 06:11 |
Laurens
Messages: 41 Registered: May 2006
|
Member |
|
|
Hi all,
At first I was kinda embarrassed to ask this but after spending my
complete day at finding a solution which appearantly I didn't find, I
don't know if the embarrassement would be fair :)
Problem: I want to draw an IDLgrPlot, with some axisses in my main
program. I have an array of [x,y] containing the data. How call the plot
in the following way:
------------------------------------------------------------ ---------
info.Scene = Obj_New('IDLgrScene')
info.View = Obj_New('IDLgrView', VIEWPLANE_RECT =
[0,0,info.xsize_widget, info.ysize_widget], /DOUBLE)
info.Model = Obj_New('IDLgrModel')
info.Scene->Add, info.View
info.View->Add, info.Model
info.Plot = obj_new('IDLgrPlot',[xData,yData])
info.View->SetProperty, Color=[0,0,0]
info.Plot->SetProperty, Color=[255,255,255]
info.Model->Add, info.Plot
(*info.ptrDrawWidget)->Draw, info.View
(*info.ptrDrawWidget)->Draw, info.Scene
--------------------------------------------------------
IDL> print, xData
0.00000000 51.000000 102.00000 153.00000
204.00000 255.00000 306.00000 357.00000
408.00000 459.00000 510.00000 561.00000
612.00000 663.00000 714.00000
765.00000 816.00000 867.00000 918.00000
969.00000 1020.0000 1071.0000 1122.0000
1173.0000 1224.0000 1275.0000 1326.0000
1377.0000 1428.0000 1479.0000
1530.0000 1581.0000 1632.0000 1683.0000
1734.0000 1785.0000 1836.0000 1887.0000
1938.0000 1989.0000 2040.0000 2091.0000
2142.0000 2193.0000 2244.0000
2295.0000 2346.0000 2397.0000 2448.0000
2499.0000 2550.0000 2601.0000 2652.0000
2703.0000 2754.0000 2805.0000 2856.0000
2907.0000 2958.0000 3009.0000
3060.0000 3111.0000 3162.0000 3213.0000
3264.0000 3315.0000 3366.0000 3417.0000
3468.0000 3519.0000 3570.0000 3621.0000
3672.0000 3723.0000 3774.0000
3825.0000 3876.0000 3927.0000 3978.0000
-----------------------------------------------------------
IDL> print, yData
0.0253906 0.0402832 0.0471191 0.0649414 0.0666504
0.0651855 0.0834961 0.0805664 0.0920410 0.0808105
0.0927734 0.0820313 0.0869141 0.0817871 0.0952148
0.105957 0.0959473 0.111084 0.108154
0.118408 0.132324 0.132080 0.150146 0.161133
0.168701 0.174072 0.181641 0.184814 0.189453
0.189453 0.191406 0.211182 0.210449 0.208496
0.220215 0.222168 0.219482 0.234619
0.222168 0.215820 0.214844 0.221924 0.217773
0.226807 0.224609 0.216064 0.219971 0.226807
0.220459 0.226318 0.231445 0.232422 0.224365
0.231689 0.230469 0.218750 0.210938
0.221924 0.222900 0.230957 0.219727 0.237793
0.224854 0.216797 0.221680 0.218018 0.224121
0.227783 0.233887 0.231934 0.226074 0.217041
0.222900 0.208740 0.221924 0.220459
0.201172 0.214844 0.220459
============================================================ =============
Now, when I execute this code, I don't get what I want. I get some
strange lines, of which you can view the result at
http://sophorus.mine.nu/idlgrplot_weird.jpg.
When I call iPlot just with the data set, I get exactly what I want.
That is, the figure is as it should be,but I need it in my program (no
ext. window) and need to draw additional things on it.
Now why isn't this working with IDLgrPlot? Appearantly I'm missing
something crucial :) but google nor davids site (about the resources I
use for getting to know what can and what can't be done :P) seem to help
me in this one.
Or, of course...I just can't search hehe :)
Who can help me? Thnx in advance!
|
|
|