Added optional matplotlib dependency for running example code