Allow tests to skip if matplotlib is not present.
Allow tests to skip if networkx is not present.
travis fix