This is a barebones setup to using TeX with matplotlib. Since the whole MacTeX package is ~4GB, and includes a lot of unnecessary binaries, it is better to install BasicTeX and install the packages as you seem fit.
The easiest way to install is by running brew cask install basictex and run which pdflatex to check whether it is installed. This should return a path with the location of the filepath. If it doesn't, then check if the /Library/TeX folder exists.
Finally, add the following to your ~/.bashrc or ~/.bash_profile filepath: export PATH="/Library/TeX/texbin/:$PATH"