Improved plot digits classification example.

Made two for loop statements more readable by introducing local variables.
Merge pull request #3063 from chalmerlowe/improved-digits-example

[MRG+1] Improved plot digits classification example.