On Nov 24, 6:29 pm, David Fanning <n...@dfanning.com> wrote:
> Hasan writes:
>> I got this error message 'Trapped Error CGWINDOW: A valid cgWindow doe
>> not exist to add a acommand to.
>
> Now I am guessing you changed the keyword on the first command
> in that series from WINDOW, which you had before, to ADDCMD.
>
> The WINDOW keyword will either replace all the commands in
> a window, if a window exists, with a particular command,
> or create a window and add the command to it. Subsequent
> commands are added with the ADDCMD keyword. If you
> need a window, you can always create one by typing cgWindow.
>
> There is a whole book on the subject if you need further
> direction. :-)
>
> 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.")
I removed the Window keyword and added cgWindow but it seems I am
missing something else. if you copy and past the following code and
see the results, please, you can see what I mean.
y1=[576.000,687.000,416.000,325.000,271.000]
y2=[665.000,702.000,527.000,493.000,433.000]
y3=[2333.00,2409.00,2168.00,1791.00,1583.00]
y4=[225.000,371.000,149.000,168.000,60.0000]
y5=[863.000,912.000,590.000,652.000,695.000]
y6=[546.000,539.000,336.000,322.000,275.000]
y7=[1431.00,1523.00,1001.00,914.000,892.000]
x=[-12,-8,0,5,10]
cgwindow
cgplot,x,y1/10000,LineStyle=0,CHARSIZE =1,color='black', xtickv=x,$
xticks=n_elements(x)-1,XTITLE='Class$
1',YTITLE='Values',Title='Differernt calsses values',/ADDCMD
cgplot,x,y2/10000,LineStyle=0,color='green',/overplot,/ADDCM D
cgplot,x,y3/10000,LineStyle=0, color='red',/overplot,/ADDCMD
cgplot,x,y4/10000,LineStyle=0, color='orange',/overplot,/ADDCMD
cgplot,x,y5/10000,LineStyle=0, color='magenta',/overplot,/ADDCMD
cgplot,x,y6/10000,LineStyle=0, color='cyan',/overplot,/ADDCMD
cgplot,x,y7/10000,LineStyle=0, color='blue',/overplot,/ADDCMD
al_legend,LineStyle=0,$
['class1','class2','class3','class4','class5','class6','clas s7']$
,color=['black','green','red','orange','magenta','cyan','blu e'],Position=[0.2,$
0.34], /Normal,CHarSIZE=0.8
|