Dear Paul,
I have found some problems with the locations of tick labels. As I am trying to implement the new %pl for plotting different types of data sets during the run of the program (they can be Current-Time, Potential-Time, Current-Potential, etc.), I have implemented a Function Legend that changes the Axis labels depending on what is plotted at a certain time. The result is that the tick labels can appear correctly located below the x-axis, for instance, but once I plotted a second data set, they move upwards (the same for the y-axis) and remain there for the rest of the run. See this code, for instance:
[code]WINAPP
MODULE mydata
USE clrwin
INTEGER n_points(2)
REAL8 xstart(2),dx(2)
INTEGER,PARAMETER::n=1000
REAL8:: y(n)=0.0,z(n)=0.0,w(n)
integer4 :: ancho,alto
logical4 :: plot=.false.
CONTAINS
INTEGER FUNCTION legend()
integer ancho2,alto2,alto3,ancho3
ancho2=ancho/2.0
alto2=alto-20
ancho3=ancho*0.05
alto3=alto/2.0
if(plot) then
CALL draw_characters@('Time/s', ancho2, alto2, 0)
CALL rotate_font@(90.0D0)
CALL draw_characters@('Current/A', ancho3, alto3, 0)
CALL rotate_font@(0.0D0)
endif
legend = 2
END FUNCTION legend
SUBROUTINE calc1(k)
INTEGER i,x,k
DOUBLE PRECISION p1,p2,p3
p1=1.5d0
p2=150.0d0
p3=15d0
x=0
plot=.true.
DO i=1,k
y(i)=p1*exp(-x/p2)
x=x+1
ENDDO
END SUBROUTINE calc1
SUBROUTINE calc2(k)
INTEGER i,x,k
DOUBLE PRECISION p1,p2,p3
p1=1.0d0
p2=150.0d0
p3=20d0
x=0
plot=.true.
DO i=1,k
z(i)=p1*exp(-x/p2)
x=x+1
ENDDO
END SUBROUTINE calc2
SUBROUTINE calc3(k)
INTEGER i,x,k
DOUBLE PRECISION p1,p2,p3
p1=2.0d0
p2=150.0d0
p3=20d0
x=0
plot=.true.
DO i=1,k
w(i)=p1*exp(-x/p2)
x=x+1
ENDDO
END SUBROUTINE calc3
INTEGER FUNCTION draw1()
CALL calc1(n_points(1))
CALL simpleplot_redraw@()
draw1 = 2
END FUNCTION draw1
INTEGER FUNCTION draw2()
CALL calc2(n_points(2))
CALL simpleplot_redraw@()
draw2 = 2
END FUNCTION draw2
INTEGER FUNCTION clear()
y = 0.0d0
z = 0.0d0
w = 0.0d0
plot=.false.
CALL simpleplot_redraw@()
clear = 2
END FUNCTION clear
INTEGER FUNCTION change()
INTEGER i
if(n_points(2) == 500)then
n_points(2) = 1000
dx(2) = 1.0d0
CALL calc3(1000)
i = CHANGE_GRAPH_STYLE@(2,0,0,255)
i = CHANGE_GRAPH_DATA@(2,0.0d0,w)
else
n_points(2) = 500
dx(2) = 2.0d0
CALL calc2(500)
i = CHANGE_GRAPH_STYLE@(2,2,4,RGB@(0,0,255))
i = CHANGE_GRAPH_DATA@(2,0.0d0,z)
endif
CALL simpleplot_redraw@()
change = 2
END FUNCTION change
END MODULE mydata
PROGRAM main
USE mydata
external legend
ancho=0.8*clearwin_info@('SCREEN_WIDTH')
alto=0.8*clearwin_info@('SCREEN_DEPTH')
n_points(1) = 1000
n_points(2) = 500
xstart = 0.0d0
dx(1) = 1.0d0
dx(2) = 2.0d0
i=winio@('%ww[no_border]%ca[Damped wave]%pv&')
i=winio@('%mn[Edit[Draw first,Draw second,Change second,Clear