I am trying to plot (1D) trajectories in 3D with Asymptote (because I am also plotting surfaces with opacity and do not want to use hacks for hidden surfaces).
Each curve is defined by points in an external csv
file. The following minimal example for one curve works properly (given a data.csv
file of course):
\documentclass[margin=1cm]{standalone}
\usepackage{asymptote}
\begin{document}
\begin{asy}
settings.outformat="pdf";
settings.prc=false;
settings.render=0;
import graph3;
currentprojection=orthographic(1,-2,4);
currentlight=(1,-1,1);
size3(200,200,80,IgnoreAspect);
file in=input("data.csv").line().csv();
real[][] a=in.dimension(0,0);
a=transpose(a);
real[] x=a[0];
real[] y=a[1];
real[] z=a[2];
draw(graph(x,y,z),blue,currentlight);
xaxis3(XY()*"$x_1$",Arrow3);
yaxis3(XY()*"$x_2$",Arrow3);
zaxis3("$y$",Arrow3);
\end{asy}
\end{document}
Now, I would like to add arrows on the curve to show the direction of the trajectory.
It seems if the trajectory was a path
, I could do it quite easily using something such as draw(pathname,Arrow(Relative(0.7)));
. But I can't manage to "convert" my graph as a curve to do so.
Any ideas how I could add arrows?
I cannot manage to plot arrows on the curves.
Best Answer
In this case you need to use
Arrow3
instead of justArrow
. With a simple data file it gives