Some examples of code in TikZ and Python's matplotlib, in varying degrees of complexity. In general, each example only introduces one or two things each.
I'd like to thank Yichuan Shen for his excellent WYSIWYG TikZ-cd editor, I strongly encourage intermediate users to read Part I from Till Tantau's TikZ & PGF manual.