Small bug in matplotlib-0.70

At my request, John Hunter put a feature in the 'load' subroutine in Pylab which treats everything after a '%' sign as a comment. This makes it more compatible with MATLAB (tm); I use this feature to comment files which would otherwise be simple lists of numbers. However, there is a small bug. Line 851 in pylab.py should change from

        line = line[:line.rfind('%')].strip()

to

        line = line[:line.find('%')].strip()

since everything after a '%' sign should be treated as a comment. This bit me when I had a comment line where the comment itself included a % sign.

Stephen Walton wrote:

At my request, John Hunter put a feature in the 'load' subroutine in Pylab which treats everything after a '%' sign as a comment. This makes it more compatible with MATLAB (tm); I use this feature to comment files which would otherwise be simple lists of numbers. However, there is a small bug. Line 851 in pylab.py should change from

       line = line[:line.rfind('%')].strip()

to

       line = line[:line.find('%')].strip()

since everything after a '%' sign should be treated as a comment. This bit me when I had a comment line where the comment itself included a % sign.

Done.

Now maybe someone can contribute a patch for 3D plots while John is in Brazil as a sign of our appreciation. :slight_smile:

Cheers!
Andrew

Andrew Straw wrote:

Stephen Walton wrote:

Line 851 in pylab.py should change from

       line = line[:line.rfind('%')].strip()

to

       line = line[:line.find('%')].strip()

Done.

Cool, thanks.

Now maybe someone can contribute a patch for 3D plots while John is in Brazil as a sign of our appreciation. :slight_smile:

Based on what I've read around here, implementing 3D plots is going to require more than a simple patch.