Quantcast
Channel: Use of plot command with a foreach loop variable - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 2

Use of plot command with a foreach loop variable

$
0
0

Edit: I wrote some nonsense before. Hopefully it makes more sense now.

I'm trying to repeat a plot in a foreach loop with the domain of the plot shifting in each iteration. I've tried shifting the parameters in the 'domain' argument to 'plot', i.e. domain={\i:2.2*pi+\i}. This fails to compile. It doesn't seem to like the \i variable in the domain. Any ideas on how to make this work?

\documentclass[tikz]{standalone}\begin{document}\begin{tikzpicture}\foreach \i in {10, 20, 30}  \draw[] plot[samples=100,domain={\i:2.2*pi + \i}] function {sin(x)};\end{tikzpicture}\end{document}

Note that I don't want a plot with axes, and I need the plot to be in the same units as the rest of my tikz drawing. So, I may be wrong, but I don't think 'addplot' is a valid solution.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images