|
The following chapter shows how to create a simple XY plot like this:
Doc_num=FNDplot_doc_new(0) ! create new document |
Xmin=0 Xmax=2*PI Xpoints=200 Xstep=Xmax/Xpoints ! ALLOCATE REAL Datxy(1:Xpoints,1:2) ! 2-dimensional array ! Xi=BASE(Datxy,1) FOR T=Xmin TO Xmax STEP Xstep Datxy(Xi,1)=SIN(2*T) ! x = sin(2*t) Datxy(Xi,2)=SIN(5*T) ! y = sin(5*t) IF Xi<Xpoints THEN Xi=Xi+1 NEXT T |
! transfer all data points to DPlot curve 1, line type 1 Dummy=FNDplot_xyz_data(Doc_num,Datxy(*),0,0,1,"x=sin(2t), y=sin(5t) {0<t<2PI}",1) |
! legend text and style for curve Dummy=FNDplot_send_cmd("[Legend(1,""x=sin(2*t),y=sin(5*t) {0<t<2*PI}"")]") ! Dummy=FNDplot_send_cmd("[Color(1,0,128,0)]") ! curve 1 = dark green Dummy=FNDplot_send_cmd("[NumberFormat(0,8)]") ! number format for x axis = fractions of PI Dummy=FNDplot_send_cmd("[ManualScale(-1.1,-1.2,1.1,1.2)]") ! manual scale of y axis |
! show the diagram, 100% screen size CALL Dplot_show(Doc_num) Dummy=FNDplot_doc_close(Doc_num) ! close the document |