,,,the rest of the code,,,
module subroutines
integer*4 flag_1,ans
real*4 :: xout=0.0,yout=0.0,xp1,yp1
real*8 :: xoutr,youtr
contains
integer function gr2_func()
call get_points
gr2_func=1
end function gr2_func
subroutine Simpleplot_plots
use mswin
use spwin
INTEGER, PARAMETER :: NARR = 8
REAL, DIMENSION(NARR) :: XARR = (/0.0, 2.0, 3.0, 4.0, 5.0, 6.0, 8.0, 10.0/)
REAL, DIMENSION(NARR) :: YARR = (/0.0, 0.8, 0.5, 0.14, 0.8, 0.8, 0.35, 0.9/)
HDC_DIM%iWidth = 600
HDC_DIM%iHeight = 450
HDC_DIM%iBitmapDC = GET_Bitmap_DC@(HDC_DIM%iWidth, HDC_DIM%iHeight)
CALL SP_SupplyBitmap ! Pass Bitmap to SIMPLEPLOT
call initsp
call pgfull(.true.)
CALL SCALES(0.0, 10.0, 1, 0.0, 1.0, 1) ! specify plotting scales
CALL AXES7('x-axis', 'y-axis') ! start picture & draw pair of axes
CALL BRKNCV(XARR, YARR, NARR, 0) ! draw curve of data
call Updatewin
end subroutine simpleplot_plots
subroutine get_points
use mswin
use spwin
flag_1=clearwin_info@('GRAPHICS_MOUSE_FLAGS')
if(flag_1==1) then
xp1=clearwin_info@('GRAPHICS_MOUSE_x')
yp1=HDC_DIM%iHeight-clearwin_info@('GRAPHICS_MOUSE_y')
call pen(12)
call kxyxy(0,xp1,yp1,5,xout,yout)
xoutr=xout
youtr=yout
!in case one wants to mark the points....
call markpt(xout,yout,5)
call updatewin
endif
end subroutine get_points
end module subroutines
Program demo
use spwin
use mswin
use subroutines
external gr2_func
call simpleplot_plots
ans=winio@('%ca[A Simple Plot]%bg[grey]&')
ans = winio@('%^dw[full_mouse_input]&',HDC_DIM%iBitmapDC,gr2_func) ! Pass bitmapDC to ClearWin
ans=winio@('%ff x = %rf %ta y = %rf&',xoutr,youtr)
ans=winio@('%ff%cn%6`bt[Close]')
end program demo