Whilst trying to plot a scatter plot with no facecolor I was able to reliably
reproduce a segfault in mpl 0.91.2 - see below:
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)]
IPython 0.8.3.svn.r3001 -- An enhanced Interactive Python.
In [1]: import matplotlib
In [2]: matplotlib.__version__
Out[2]: '0.91.2'
In [3]: from pylab import scatter, rand
In [4]: scatter(rand(100),rand(100),c='')
<--SegFault-->
That's probably not the right way to do it but it does work in 0.98.0.
I'm unable to test on 0.91.3 at the moment.
NB: The work-around (correct way?) to get the same result in 0.91.2 is:
Whilst trying to plot a scatter plot with no facecolor I was able to reliably
reproduce a segfault in mpl 0.91.2 - see below:
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)]
IPython 0.8.3.svn.r3001 -- An enhanced Interactive Python.
In [1]: import matplotlib
In [2]: matplotlib.__version__
Out[2]: '0.91.2'
In [3]: from pylab import scatter, rand
In [4]: scatter(rand(100),rand(100),c='')
<--SegFault-->
That's probably not the right way to do it but it does work in 0.98.0.
I'm unable to test on 0.91.3 at the moment.
On ubuntu hardy with 0.91.3 from the svn maintenance branch:
In [1]:import matplotlib
In [2]:matplotlib.__version__
Out[2]:'0.91.3'
In [3]:from pylab import scatter, rand
In [4]:scatter(rand(100), rand(100), c='')
Out[4]:<matplotlib.collections.RegularPolyCollection instance at 0x8edf04c>
It's giving a floating point exception on the following operation:
i % Nface
where Nface is the number of face colors, which in this case is 0.
We probably want to trap for this case in the C code so it at least doesn't crash, but am I right that "c=''" is an invalid input? What should that do, if not raise an exception?
Cheers,
Mike
Eric Firing wrote:
···
Dave wrote:
Whilst trying to plot a scatter plot with no facecolor I was able to reliably
reproduce a segfault in mpl 0.91.2 - see below:
Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)]
IPython 0.8.3.svn.r3001 -- An enhanced Interactive Python.
In [1]: import matplotlib
In [2]: matplotlib.__version__
Out[2]: '0.91.2'
In [3]: from pylab import scatter, rand
In [4]: scatter(rand(100),rand(100),c='')
<--SegFault-->
That's probably not the right way to do it but it does work in 0.98.0.
I'm unable to test on 0.91.3 at the moment.
On ubuntu hardy with 0.91.3 from the svn maintenance branch:
In [1]:import matplotlib
In [2]:matplotlib.__version__
Out[2]:'0.91.3'
In [3]:from pylab import scatter, rand
In [4]:scatter(rand(100), rand(100), c='')
Out[4]:<matplotlib.collections.RegularPolyCollection instance at 0x8edf04c>
facecolor='' or facecolor='None' in other parts of the code (eg
Line2D), mean do not fill the marker. But the principle of least
surprise, we should probably support this for the polygon collections
too, unless there is a good reason not to.
JDH
···
On Mon, Jun 2, 2008 at 7:45 AM, Michael Droettboom <mdroe@...31...> wrote:
We probably want to trap for this case in the C code so it at least
doesn't crash, but am I right that "c=''" is an invalid input? What
should that do, if not raise an exception?
On Mon, Jun 2, 2008 at 7:45 AM, Michael Droettboom <mdroe@...31...> wrote:
We probably want to trap for this case in the C code so it at least
doesn't crash, but am I right that "c=''" is an invalid input? What
should that do, if not raise an exception?
facecolor='' or facecolor='None' in other parts of the code (eg
Line2D), mean do not fill the marker. But the principle of least
surprise, we should probably support this for the polygon collections
too, unless there is a good reason not to.
JDH
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA