Dan,
This is the closest I can get to your requirements without resorting to drawing on the %pl via the call back. I thought it was going to be easy, but I had forgotten that %pl[width] applies to ALL graphs.
Ken
winapp
module dan_mod
use clrwin
implicit none
integer, parameter :: dp=kind(1.d0)
integer, parameter :: n_candles = 20
real(kind=dp) x(1:n_candles), y_min(1:n_candles), y_low(1:n_candles), y_high(1:n_candles), y_max(1:n_candles)
integer n_graphs
integer, allocatable :: n_points(:)
real(kind=dp), allocatable :: x_pl(:), y_pl(:)
contains
integer function create_data()
integer i
do i = 1, n_candles
x(i) = i
y_max(i) = 100 * random@()
y_high(i) = y_max(i) * random@()
y_low(i) = y_high(i) * random@()
y_min(i) = y_low(i) * random@()
print '(I4,1X,4(F6.3,1X))', i, y_max(i), y_high(i), y_low(i), y_min(i)
end do
create_data = 1
end function create_data
integer function plot_data()
integer i, j, counter
integer iw
character(len=128) pl_str
n_graphs = 2*n_candles
allocate( n_points(1:n_graphs) ) ; n_points = 2
allocate( x_pl(4*n_candles), y_pl(4*n_candles) )
counter = 1
do j = 1, n_candles, 1
do i = 1, 4, 1
x_pl(counter) = x(j)
counter = counter + 1
end do
end do
counter = 1
do j = 1, n_candles, 1
y_pl(counter) = y_min(j)
y_pl(counter + 1) = y_max(j)
y_pl(counter + 2) = y_low(j)
y_pl(counter + 3) = y_high(j)
counter = counter + 4
end do
iw = winio@('%mn[Exit]&','exit')
iw = winio@('%fn[Consolas]&')
iw = winio@('%ts%bf&',1.5d0)
write(pl_str,'('%pl[native,stacked,n_graphs=',I4,']')') n_graphs ! ; print*, pl_str
call winop@(pl_str)
call winop@('%pl[x_array, independent, frame, gridlines]')
do i = 1, n_candles
call winop@('%pl[link=lines,width=1,colour=blue,pen_style=2]') !Does not work as written since width applies to all graphs
call winop@('%pl[link=lines,width=5,colour=red, pen_style=0]') !Changed pen_style as alternative
end do
iw = winio@('%pl&',900,600,n_points,x_pl,y_pl)
iw = winio@(' ')
plot_data = 1
end function plot_data
end module dan_mod
program main
use dan_mod
implicit none
integer i
i = create_data()
i = plot_data()
end program main