|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
aebolzan
Joined: 06 Jul 2007 Posts: 229 Location: La Plata, Argentina
|
Posted: Wed Jun 09, 2010 9:57 pm Post subject: |
|
|
,,,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 |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2816 Location: South Pole, Antarctica
|
Posted: Sun Jun 13, 2010 7:08 pm Post subject: |
|
|
Did you find also the solution for shifted axis labels in Simpleplot?
All x axis labels are shifted to the left, all Y axis labels to the bottom instead of being centered respect tick marks. You are permanently guessing which tick this label is marking - left or right, upper or lower.
That couple of defects (and another was CGA 4bit palette for color graphs) is so damn retarded, that it maddened me to the extent of not accepting Simpleplot at all. I wrote to the author a decade ago when he was still supporting it. Got no respond. |
|
Back to top |
|
|
aebolzan
Joined: 06 Jul 2007 Posts: 229 Location: La Plata, Argentina
|
Posted: Mon Jun 14, 2010 3:47 am Post subject: |
|
|
Well, well, nobody is perfect in this world......the answer is no, I have not found a solution for that problem, although I can say that in the case of the x-axis the labels can be centred using the subroutine AXLBJS('**', 'Centre'), but the y-axis still shows a small shift downwards at each tick, but the shift is not so critical, at least in my case, that makes the graph confusing as you say (if you try my example you will see that the labels are almost touching the ticks, so that the identification of ticks with labels seems to be rather obvious, but I have not checked it with all possible types of graphs!). Obviously I would prefer to see that the "centre" argument in the subroutine really produces a centred label, as one should expect for such a name, but what are my other options?: a) make the graph using only FTN95 subroutines (I do not know how to do that in a simple and easy way); b) use SIMDEM (which I tried twice and found not as easy to do as with Simpleplot, i.e. there is a learning curve that requires more time than what I want to spend at the moment); c) use DSLIN subroutines for FTN95 (same as SIMDEM); d) buy something like GINO (too expensive for me, and the examples they show in the web site show also no centred y-labels! that's funny...).
Best regards,
Agustin |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|