|
The following chapter shows how to create a XYZ surface plot similar to this:
Doc_num=FNDplot_doc_new(3) ! create new 3D document |
Xstep=.15 ! x step value Xmin=0 ! x start value Xmax=10 ! x stop value Ystep=.15 ! y step value Ymin=0 ! y start value Ymax=10 ! y stop value Xpoints=(Xmax-Xmin)/Xstep+1 Ypoints=(Ymax-Ymin)/Ystep+1 ! ALLOCATE REAL Datxyz(1:Xpoints,1:Ypoints,1:3) ! 3-dimensional array Xbase=BASE(Datxyz,1) Ybase=BASE(Datxyz,2) ! Xi=Xbase FOR X=Xmin TO Xmax STEP Xstep Yi=Ybase FOR Y=Ymin TO Ymax STEP Ystep Z=SIN(X)*COS(Y) ! Datxyz(Xi,Yi,1)=X Datxyz(Xi,Yi,2)=Y Datxyz(Xi,Yi,3)=Z IF Yi<Ypoints THEN Yi=Yi+1 NEXT Y IF Xi<Xpoints THEN Xi=Xi+1 NEXT X |
! now transfer all data points to new DPlot curve (curve 1) Dummy=FNDplot_xyz_data(Doc_num,Datxyz(*),0,0,1,Z_$,1) DEALLOCATE Datxyz(*) |
Dummy=FNDplot_send_cmd("[Contour3D(1)]","") ! 3D contour diagram |
Dummy=FNDplot_send_cmd("[ContourGrid(0)]") ! no grid Dummy=FNDplot_send_cmd("[ContourLighting(1,0)]") ! ligthing options = gouraud Dummy=FNDplot_send_cmd("[ContourView(30,35)]") ! contour view options Dummy=FNDplot_send_cmd("[ContourColorScheme(2)]") ! custom colors for contour plot Dummy=FNDplot_send_cmd("[ContourCustomColors(65535,32768)]") ! yellow to green ! Document title 1 Dummy=FNDplot_send_cmd("[Title1(""3D Contour Plot created by HTBasic"")]") |
! show the diagram in a Basic Plus widget, 100% screen size CALL Dplot_show(Doc_num,"",1,0,100,100,100,@Bitmap1) Dummy=FNDplot_doc_close(Doc_num) ! close the document |
|