# load the function
source('arrows_on_axes_function.R')

svg('arrows_on_axes.svg', height=3, width=3)
par(plt=c(25, 92.5, 17.5, 92.5)/100, tck=0.02, xpd=NA)
plot(x=c(-5, 5.25), y=c(-1, 1.25), type='n', xlab='', ylab='', axes=F)
usr = par('usr')
axis(1, col=NA, col.ticks=1, mgp=c(0,2,0)/10)
axis(2, col=NA, col.ticks=1, mgp=c(0,3,0)/10, las=1)
mtext(1, text='x', line=1.5)
mtext(2, text='y', line=2.5, las=1)
curve(add=T, expr=cos, from=usr[1], to=usr[2], lty=2)
lines(x=c(usr[c(1,1,2)]), y=c(usr[c(4,3,3)]))

# use the function
axis_arrow(0.05)

# example using other parameters
# axis_arrow(0.05, 1, color='gray')

graphics.off()