Kenneth_Smith
Joined: 18 May 2012 Posts: 840 Location: Lanarkshire, Scotland.
|
Posted: Wed Sep 03, 2025 1:25 pm Post subject: Set_plot_mode@(1) with draw_symbolsd@ |
|
|
Paul,
Does the plot generated by the following code look as you would expect it to ?
I thought that draw_symbolsD@ would clip symbols outside the %pl[frame] with a similar behaviour to draw_polylined@?
Code: |
module ex27_mod
use clrwin
implicit none
integer :: width=500, height=500
integer, parameter :: n = 21
real*8 :: x(n), y1(n), y2(n), y3(n)
contains
integer function start()
integer iw, i
character(len=*),parameter :: fmt1='(22(I3,4(2X,F7.2)/))'
x = [(i, i=-10,10,1)]
y1 = [(x(i)**2, i = 1,n)] -5.d0
y2 = y1 + 50.d0
y3 = y2 + 40.d0
write(*,fmt1) (i, x(i), y1(i), y2(i), y3(i), i = 1, n)
iw = winio@('%fn[Arial]%ts%bg&',1.25d0,rgb@(220,220,220))
call winop@('%pl[native,n_graphs=1,frame,x_array]')
call winop@('%pl[link=user]')
call winop@('%pl[margin=100]')
call winop_flt@('%pl[x_min]', -4.d0) ! Some points will be outside frame
call winop_flt@('%pl[x_max]', 4.d0)
call winop_flt@('%pl[y_min]', 0.d0)
call winop_flt@('%pl[y_max]', 100.d0)
iw = winio@('%^pl',width,height,2,[0.d0,1.d0],[0.d0,1.d0],pl_cb)
start = 2
end function start
integer function pl_cb()
if (clearwin_string@('CALLBACK_REASON') .eq. 'PLOT_ADJUST') then
call set_plot_mode@(1)
call set_line_width@(2)
call draw_polylined@(x,y1,n,rgb@(255,0,0))
call draw_symbolsd@(x,y1,n,6,4,rgb@(255,0,0))
call draw_polylined@(x,y2,n,rgb@(0,0,255))
call draw_symbolsd@(x,y2,n,6,4,rgb@(0,0,255))
call draw_polylined@(x,y3,n,rgb@(0,255,0))
call draw_symbolsd@(x,y3,n,6,4,rgb@(0,255,0))
call set_plot_mode@(0)
end if
pl_cb = 2
end function pl_cb
end module ex27_mod
program ex27
use ex27_mod
i = start()
end program ex27 |
|
|