I tried plotting $\cos^2{(\frac{\pi}{L}x)}$ with a couple of different values for $L$ on my computer to get an intuitive feeling for what the function looks like.
I.e:
$L=0.1$
$L=2$
$L=10$

What I noticed is that $L$ results plots the same graph as $-L$. But how can I formalize the drawings for all values of $L$? What would be a sufficient way to approach this?
Define a dimensionless variable, $\textit{e.g.}$ $\xi=x/L$ with $\xi\in[-1,1]$. Therefore all your graphs will fit within this interval whatever $L$ is.
You will have then: $$f(\xi)=\cos^2{(\xi\pi)} \qquad \xi\in[-1,1]$$