use apt-get instead of pip for matplotlib