# Arbitrary sinewave diagrams in LaTeX

I needed to be able to generate a number of figures for a phonetics homework assignment showing an arbitrary number of component sine waves and the complex wave you get if you sum them.

TikZ and gnuplot to the very enjoyable and useful rescue! The only tricky part is that Tikz wants to call gnuplot to plot the functions. I don’t let LaTeX execute arbitrary commands (for what are probably obvious reasons), but tikz generates intermediate <filename>.gnuplot files so I just had to add a line to execute these with gnuplot to the makefile for my homework assignment.

Example one: and the code to create it.

Example two: and the code to create it.

posted in: latex, phonetics, and teaching