Pro cnaroa1
loadct,5
window,1,xsize=280,ysize=170
status=dc_read_free('c:\msoffice\excel\esm5984\cnca.csv',$
cn,ca,roa,/col) ;Reads data set
plot,ca,roa,color=234,background=32,xrange=[-.2,6.2],yrange=[-.40,.40],$
xticks=6,xtickv=[0,1,2,3,4,5,6] ,charsize=.7,yticklen=.5,$
title="!3Occurrences of ROA",$
xtitle="Competitive Advantage Rating",$
ytitle="Return on Assets", thick =1,/nodata
j=where(roa gt 0) ;Assigns color to different
oplot,ca(j),roa(j),psym=1,color=180 ;levels of return on assets
i=where(roa le 0)
oplot,ca(i),roa(i),psym=1,color=100 ;Plots first image
window,2,xsize=280,ysize=170
plot,cn,roa,color=234,background=32,xrange=[-.2,6.2],yrange=[-.40,.40],$
xticks=6,xtickv=[0,1,2,3,4,5,6],charsize=.7,yticklen=.5,$
title="!3Occurrences of ROA",$
xtitle="Competitive Neccessity Rating",$
ytitle="Return on Assets", thick =1,/nodata
j=where(roa gt 0)
oplot,cn(j),roa(j),psym=1,color=180
i=where(roa le 0)
oplot,cn(i),roa(i),psym=1,color=100 ;Plots second image
end
Program CNCA was used to create the four, three-dimensional
scatterplots and the animation of a three-dimensional scatterplot.
Filenames and variable names were changed each time the program was run.
PRO cnca
;
status=dc_read_free('c:\msoffice\excel\esm5984\cnca.csv',$
cn,diff,roa,/col) ;Reads excel file
loadct,5
;
bz=45
for k=1,37 do begin
window,0,xsize=350,ysize=270,title='CN,CA,ROA'
bx=20
ndgr=10
;
openw,4,'temp.dat' ;Creates filenames that
if (k lt 10)then printf,4,format='(i1)',k ; include image number
if (k ge 10)then printf,4,format='(i2)',k
close,4
openr,4,'temp.dat'
nn="
readf,4,nn
if (k lt 10)then pp="cnca0"+nn+".bmp"
if (k ge 10)then pp="cnca"+nn+".bmp"
close,4
surface, findgen(2,2), /Nodata, /Save,xrange=[-.2,6.2],yrange=[-.2,6.2],$
zrange=[-.35,.35],background=32,color=234,xtitle='CN rating',$
ytitle='CA Rating',ztitle='ROA',xcharsize=1.5,ycharsize=1.5,$
zcharsize=1.5,zvalue=0,/noerase,xticks=6,xtickv=[0,1,2,3,4,5,6],$
yticks=6,ytickv=[0,1,2,3,4,5,6], ax=bx, az=bz,charsize=1,
g=where (roa le -.1) ;Assigns colors to
plots,cn(g),diff(g),roa(g),/T3d,color=180,psym=1;different levels
i=where((roa le 0) and (roa gt -.1)) ;of return on assets
plots,cn(i),diff(i),roa(i),/T3d,color=100,psym=1
h=where ((roa gt 0) and (roa lt .1))
plots,cn(h),diff(h),roa(h),/T3d,color=144,psym=1
j=where(roa ge .1)
plots,cn(j),diff(j),roa(j),/T3d,color=50,psym=1
;
status=wwrite_dib(filename=pp)
bz=bz+ndgr ;Increase angle of z-axis
wdelete
endfor
end