I am trying to learn Asymptote as I use it. I was trying to reproduce the image shown below, via Asymptote's axis (grid) functions (or any other package, such as graph.asy). I wasn't able to understand the corresponding portion of the manual and I wasn't able to find anyplace in the Charles Staat tutorial on point. Also, I wasn't able to find any samples that were on point.
I finally created the graph manually, with the following inline code. How could I have duplicated the graph with pre-existing Asymptote functions?
\begin{asy}
size(3.3cm,3.3cm);
defaultpen(fontsize(9pt));
for (int i = -12; i <= 12; ++i) {
draw((i/2,-2pi) -- (i/2, 2pi), palegrey);
if (i %2 == 0) { draw((i/2,-2pi) -- (i/2, 2pi), grey); }
if (i %4 == 0) { label(string(i/2,2), (i/2, -2pi), S, fontsize(8pt)); }
}
for (int i = -2; i <= 2; ++i) {
draw((-2pi,i*pi) -- (2pi,i*pi), grey);
if (i == 0)
{ label("$0$", (-2pi, 0), W, fontsize(8pt)); }
else
{ label(string(i,2) + "pi", (-2pi, i*pi), W, fontsize(8pt)); }
}
\end{asy}