|
The following chapter shows how to create a simple bar chart plot like this:
Doc_num=FNDplot_doc_new(0) ! create new document |
Xmin=0 Xmax=PI Xpoints=50 Xstep=Xmax/Xpoints ALLOCATE REAL Datxy(1:Xpoints,1:2) ! 2-dimensional array Xi=BASE(Datxy,1) FOR X=Xmin TO Xmax STEP Xstep Datxy(Xi,1)=X ! x value bar chart curve 1 Datxy(Xi,2)=ABS(SIN(X)) ! y value bar chart curve 1 IF Xi<Xpoints THEN Xi=Xi+1 NEXT X |
! transfer all data points to DPlot curve 1, line type 1 Dummy=FNDplot_xyz_data(Doc_num,Datxy(*),0,0,1,"y=sin(x) {0<x<PI}",1) |
Dummy=FNDplot_send_cmd("[Scale(9)]") ! create bar chart plot |
Dummy=FNDplot_send_cmd("[Legend(1,""y=sin(x) {0<x<PI}"")]") Dummy=FNDplot_send_cmd("[FillStyle(1,1)]") ! Fill style for curve 1 = solid Dummy=FNDplot_send_cmd("[Color(1,0,128,0)]") ! curve 1 = dark green Dummy=FNDplot_send_cmd("[ManualScale(,0,,1.1)]") ! manual scale of y axis |
CALL Dplot_show(Doc_num) ! show the diagram, 100% screen size Dummy=FNDplot_doc_close(Doc_num) ! close the document |