I have been testing this new version of %pl and found some issues. I have added to your example a second function z(n):
WINAPP
MODULE mydata
USE clrwin
C_EXTERNAL SET_GRAPH_STYLE@ '__set_graph_style'(VAL,VAL,VAL):INTEGER*4
INTEGER,PARAMETER::n=1000
INTEGER n_points
real*8:: y(n)=0.0,z(n)=0.0
CONTAINS
INTEGER FUNCTION draw()
INTEGER i,x
DOUBLE PRECISION p1,p2,p3
p1=1.5d0
p2=150.0d0
p3=15d0
x=0
DO i=1,n
y(i)=p1*sin(x/p3)*exp(-x/p2)
x=x+1
ENDDO
i = set_graph_style@(0,1,0)
CALL simpleplot_redraw@()
draw = 2
END FUNCTION draw
INTEGER FUNCTION draw2()
INTEGER i,x
DOUBLE PRECISION p2,p3,p4
p2=150.0d0
p3=20d0
p4=2
x=0
DO i=1,n
z(i)=p4*sin(x/p3)*exp(-x/p2)
x=x+1
ENDDO
i = set_graph_style@(0,2,2)
CALL simpleplot_redraw@()
draw2 = 2
END FUNCTION draw2
INTEGER FUNCTION clear()
CALL clear_screen@()
i = set_graph_style@(0,1,3)
i = set_graph_style@(0,2,3)
CALL simpleplot_redraw@()
clear = 2
END FUNCTION clear
END MODULE mydata
PROGRAM main
USE mydata
C_EXTERNAL WINOP@ '__winop'(INSTRING)
n_points = 1000
i=winio@('%ww[no_border]%ca[Damped wave]%pv&')
i=winio@('%mn[Edit[Draw,draw2, Clear]]&', draw, draw2,clear)
i=winio@('%fn[Tahoma]&')
i=winio@('%ts&', 1.1d0)
i=winio@('%tc&',rgb@(0,0,80))
i=winio@('%it&')
i=winio@('%`bg&',rgb@(230,255,225))
CALL winop@('%pl[native]')
CALL winop@('%pl[style=3]') ! curve joins points
CALL winop@('%pl[style=3]') ! curve joins points
CALL winop@('%pl[pen_style=0]')
CALL winop@('%pl[pen_style=4]')
CALL winop@('%pl[title='Sample plot']')
CALL winop@('%pl[x_axis=Time(Milliseconds)]')
CALL winop@('%pl[y_axis=Amplitude@(-4.0)]')
CALL winop@('%pl[smoothing=4]') ! anti-aliasing
CALL winop@('%pl[smoothing=4]') ! anti-aliasing
CALL winop@('%pl[width=1]')
CALL winop@('%pl[width=4]')
i=winio@('%pl[colour=red,colour=blue,N_GRAPHS=2]',500,400,n_points,0.0d0,1.0d0,y,z)
END
The first problem I found is that 'style' should be set to 3, or the program crashes (in the NativePl.txt says that one can set 0,1,2, but seems that the old 'style' has been replaced by the SET_GRAPH_STYLE@, right? ). I do not understand quite well the actual meaning of 'style' (maybe because I am using the 'set_graph_style@(0,1,0)' the use of style=3 is mandatory?) . The second issue I found is that the second 'width' is used for both plots. I guess this is a bug. For the rest, it seems that all works fine. I have run several times the program changing options and worked. I still have to test the use of %`pl for plotting one or the other plot.
Agustin