Paul,
I have looked at this a little more closely, as my 'fix' fails in one test.
In the following code, the failure of change_plot_dbl@ to change the dy value is demonstrated.
There are three %pl regions which are created sequentially. In each case the pl graph frame is initially the unit square. The callback associated with the button CB, calls change_plot_dbl@ to change the following values:
x_min = -5, x_max = 5, dx = 5, y_min = -5, y_max = 5, and dy = 5
and thereafter calls simpleplot_redraw@.
The code works as expected for the first two cases, but fails in the final case where the plotted dy value is 2.5 rather than the requested 5.
The only difference is that the final case has the %pl margins explicitly specified via a call to winop. The presence of this margin specification appears to be the cause of the problem.
program p
use clrwin
implicit none
integer iw
integer cd ; external cb
iw = winio@('%mn[Exit]&','exit')
iw = winio@('%fn[Consolas]%ts%bf&',1.5d0)
call winop@('%pl[native,x_array,frame,link=user]')
iw = winio@('%pl&', 500,500,2,[0.d0,1.d0],[0.d0,1.d0])
iw = winio@('%sf%^bn[CB]',cb)
iw = winio@('%mn[Exit]&','exit')
iw = winio@('%fn[Consolas]%ts%bf&',1.5d0)
call winop@('%pl[native,x_array,frame,link=user]')
iw = winio@('%pl&', 1344,876,2,[0.d0,1.d0],[0.d0,1.d0])
iw = winio@('%sf%^bn[CB]',cb)
iw = winio@('%mn[Exit]&','exit')
iw = winio@('%fn[Consolas]%ts%bf&',1.5d0)
call winop@('%pl[native,x_array,frame,link=user]')
call winop@('%pl[margin=(294,60,294,60)]')
iw = winio@('%pl&', 1344,876,2,[0.d0,1.d0],[0.d0,1.d0])
iw = winio@('%sf%^bn[CB]',cb)
end program p
integer function cb()
use clrwin
integer i
i = change_plot_dbl@(0,'x_min',0,-5.d0)
i = change_plot_dbl@(0,'x_max',0, 5.d0)
i = change_plot_dbl@(0,'dx', 0, 5.d0)
i = change_plot_dbl@(0,'y_min',0,-5.d0)
i = change_plot_dbl@(0,'y_max',0, 5.d0)
i = change_plot_dbl@(0,'dy', 0, 5.d0)
call simpleplot_redraw@()
cb = 2
end function cb