SourceForge logo
SourceForge logo
Menu

matplotlib-devel

From: elmar w. <el...@ne...> - 2015年07月03日 15:40:15
Hi all,
violinplot is crashing with singular matrix data. See example.
Is this behaviour for a singular matrix intended or just a bug?
Cheers
Elmar
#####################################################
import numpy as np
import matplotlib.pyplot as plt
# data mimicing the
# original cumsum data (may sum up to 100)
N = 100
y1 = np.random.randn(N) + 3.0
y2 = np.random.randn(N) * 5.0 + 50
y3 = np.ones(N) * 100 # data set causing violinplot problem
plt.violinplot([y1, y2, y3])
plt.boxplot([y1, y2, y3]) # ok
plt.ylim(0,110)
#####################################################
OS:	Debian
Anaconda 2.3.0 (64-bit)
Python 2.7.10
numpy 2.3.0
matplotlib 1.4.3
From: Thomas C. <tca...@gm...> - 2015年07月03日 15:53:03
The KDE computation code is a copy of the KDE code from scipy (
https://github.com/scipy/scipy/blob/master/scipy/stats/kde.py), I suggest
raising this issue on their mailing list/github.
I strongly suspect that violin plot should be doing data sanitation on the
way in or catching exceptions like this, but I am not familiar enough with
the math to be sure what it should do instead.
Tom
On Fri, Jul 3, 2015 at 11:41 AM elmar werling <el...@ne...> wrote:
>
> Hi all,
>
> violinplot is crashing with singular matrix data. See example.
>
> Is this behaviour for a singular matrix intended or just a bug?
>
> Cheers
> Elmar
>
>
>
> #####################################################
> import numpy as np
> import matplotlib.pyplot as plt
>
> # data mimicing the
> # original cumsum data (may sum up to 100)
> N = 100
> y1 = np.random.randn(N) + 3.0
> y2 = np.random.randn(N) * 5.0 + 50
> y3 = np.ones(N) * 100 # data set causing violinplot problem
>
> plt.violinplot([y1, y2, y3])
>
> plt.boxplot([y1, y2, y3]) # ok
> plt.ylim(0,110)
>
> #####################################################
>
> OS: Debian
> Anaconda 2.3.0 (64-bit)
> Python 2.7.10
> numpy 2.3.0
> matplotlib 1.4.3
>
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> Matplotlib-devel mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>
From: elmar w. <el...@ne...> - 2015年07月04日 10:29:08
from an end user point of view, matplotlibs violinplot should just do 
the same as seaborns violinplot.
#####################################################################
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
N = 100
y1 = np.random.randn(N) + 3.0
y2 = np.random.randn(N) * 5.0 + 50
y3 = np.ones(N) * 100 # causing plt.violinplot problem
y4 = np.arange(0) # causing plt.violinplot problem
#plt.violinplot([y1, y2, y3, y4])
sns.violinplot(data=[y1, y2, y3, y4])
On 03.07.2015 17:52, Thomas Caswell wrote:
> The KDE computation code is a copy of the KDE code from scipy
> (https://github.com/scipy/scipy/blob/master/scipy/stats/kde.py), I
> suggest raising this issue on their mailing list/github.
>
> I strongly suspect that violin plot should be doing data sanitation on
> the way in or catching exceptions like this, but I am not familiar
> enough with the math to be sure what it should do instead.
>
> Tom
>
> On Fri, Jul 3, 2015 at 11:41 AM elmar werling
> <el...@ne...
> <mailto:el...@ne...>> wrote:
>
>
> Hi all,
>
> violinplot is crashing with singular matrix data. See example.
>
> Is this behaviour for a singular matrix intended or just a bug?
>
> Cheers
> Elmar
>
>
>
> #####################################################
> import numpy as np
> import matplotlib.pyplot as plt
>
> # data mimicing the
> # original cumsum data (may sum up to 100)
> N = 100
> y1 = np.random.randn(N) + 3.0
> y2 = np.random.randn(N) * 5.0 + 50
> y3 = np.ones(N) * 100 # data set causing violinplot problem
>
> plt.violinplot([y1, y2, y3])
>
> plt.boxplot([y1, y2, y3]) # ok
> plt.ylim(0,110)
>
> #####################################################
>
> OS: Debian
> Anaconda 2.3.0 (64-bit)
> Python 2.7.10
> numpy 2.3.0
> matplotlib 1.4.3
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> Matplotlib-devel mailing list
> Mat...@li...
> <mailto:Mat...@li...>
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
>
>
>
> _______________________________________________
> Matplotlib-devel mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>
From: Thomas C. <tca...@gm...> - 2015年07月04日 13:23:42
Yes, that seems reasonable. @elmar you seem to have a pretty good grasp of
the code and the use case, would you mind taking a crack at adding those
special cases?
Tom
On Sat, Jul 4, 2015 at 8:58 AM elmar werling <el...@ne...> wrote:
> having a look at seaborns ViolinPlotter class
> (https://github.com/mwaskom/seaborn/blob/master/seaborn/categorical.py),
> they explicit handle the special case of "no data" and "single unique
> datapoint" at line 580 ff.
>
> Could something similar be added to matplotlibs violinplot?
>
> On 04.07.2015 12:28, elmar werling wrote:
> > from an end user point of view, matplotlibs violinplot should just do
> > the same as seaborns violinplot.
> >
> >
> > #####################################################################
> > import numpy as np
> > import matplotlib.pyplot as plt
> > import seaborn as sns
> >
> > N = 100
> > y1 = np.random.randn(N) + 3.0
> > y2 = np.random.randn(N) * 5.0 + 50
> > y3 = np.ones(N) * 100 # causing plt.violinplot problem
> > y4 = np.arange(0) # causing plt.violinplot problem
> >
> > #plt.violinplot([y1, y2, y3, y4])
> >
> > sns.violinplot(data=[y1, y2, y3, y4])
> >
> >
> > On 03.07.2015 17:52, Thomas Caswell wrote:
> >> The KDE computation code is a copy of the KDE code from scipy
> >> (https://github.com/scipy/scipy/blob/master/scipy/stats/kde.py), I
> >> suggest raising this issue on their mailing list/github.
> >>
> >> I strongly suspect that violin plot should be doing data sanitation on
> >> the way in or catching exceptions like this, but I am not familiar
> >> enough with the math to be sure what it should do instead.
> >>
> >> Tom
> >>
> >> On Fri, Jul 3, 2015 at 11:41 AM elmar werling
> >> <el...@ne...
> >> <mailto:el...@ne...>> wrote:
> >>
> >>
> >> Hi all,
> >>
> >> violinplot is crashing with singular matrix data. See example.
> >>
> >> Is this behaviour for a singular matrix intended or just a bug?
> >>
> >> Cheers
> >> Elmar
> >>
> >>
> >>
> >> #####################################################
> >> import numpy as np
> >> import matplotlib.pyplot as plt
> >>
> >> # data mimicing the
> >> # original cumsum data (may sum up to 100)
> >> N = 100
> >> y1 = np.random.randn(N) + 3.0
> >> y2 = np.random.randn(N) * 5.0 + 50
> >> y3 = np.ones(N) * 100 # data set causing violinplot problem
> >>
> >> plt.violinplot([y1, y2, y3])
> >>
> >> plt.boxplot([y1, y2, y3]) # ok
> >> plt.ylim(0,110)
> >>
> >> #####################################################
> >>
> >> OS: Debian
> >> Anaconda 2.3.0 (64-bit)
> >> Python 2.7.10
> >> numpy 2.3.0
> >> matplotlib 1.4.3
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> Don't Limit Your Business. Reach for the Cloud.
> >> GigeNET's Cloud Solutions provide you with the tools and support
> that
> >> you need to offload your IT needs and focus on growing your
> business.
> >> Configured For All Businesses. Start Your Cloud Today.
> >> https://www.gigenetcloud.com/
> >> _______________________________________________
> >> Matplotlib-devel mailing list
> >> Mat...@li...
> >> <mailto:Mat...@li...>
> >> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
> >>
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> Don't Limit Your Business. Reach for the Cloud.
> >> GigeNET's Cloud Solutions provide you with the tools and support that
> >> you need to offload your IT needs and focus on growing your business.
> >> Configured For All Businesses. Start Your Cloud Today.
> >> https://www.gigenetcloud.com/
> >>
> >>
> >>
> >> _______________________________________________
> >> Matplotlib-devel mailing list
> >> Mat...@li...
> >> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
> >>
> >
> >
> >
> ------------------------------------------------------------------------------
> > Don't Limit Your Business. Reach for the Cloud.
> > GigeNET's Cloud Solutions provide you with the tools and support that
> > you need to offload your IT needs and focus on growing your business.
> > Configured For All Businesses. Start Your Cloud Today.
> > https://www.gigenetcloud.com/
> >
>
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> Matplotlib-devel mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>
From: elmar w. <el...@ne...> - 2015年07月06日 18:45:14
Hi Tom,
tried to understand the internals of matplotlib during the weekend. 
Sorry, cound not figure out how matloblib works and where to catch the 
exceptions.
It would be appreciated if someone of the dev group could add the 
special cases handling.
Elmar
On 04.07.2015 15:23, Thomas Caswell wrote:
> Yes, that seems reasonable. @elmar you seem to have a pretty good grasp
> of the code and the use case, would you mind taking a crack at adding
> those special cases?
>
> Tom
>
> On Sat, Jul 4, 2015 at 8:58 AM elmar werling <el...@ne...
> <mailto:el...@ne...>> wrote:
>
> having a look at seaborns ViolinPlotter class
> (https://github.com/mwaskom/seaborn/blob/master/seaborn/categorical.py),
> they explicit handle the special case of "no data" and "single unique
> datapoint" at line 580 ff.
>
> Could something similar be added to matplotlibs violinplot?
>
> On 04.07.2015 12:28, elmar werling wrote:
> > from an end user point of view, matplotlibs violinplot should just do
> > the same as seaborns violinplot.
> >
> >
> > #####################################################################
> > import numpy as np
> > import matplotlib.pyplot as plt
> > import seaborn as sns
> >
> > N = 100
> > y1 = np.random.randn(N) + 3.0
> > y2 = np.random.randn(N) * 5.0 + 50
> > y3 = np.ones(N) * 100 # causing plt.violinplot problem
> > y4 = np.arange(0) # causing plt.violinplot problem
> >
> > #plt.violinplot([y1, y2, y3, y4])
> >
> > sns.violinplot(data=[y1, y2, y3, y4])
> >
> >
> > On 03.07.2015 17:52, Thomas Caswell wrote:
> >> The KDE computation code is a copy of the KDE code from scipy
> >> (https://github.com/scipy/scipy/blob/master/scipy/stats/kde.py), I
> >> suggest raising this issue on their mailing list/github.
> >>
> >> I strongly suspect that violin plot should be doing data
> sanitation on
> >> the way in or catching exceptions like this, but I am not familiar
> >> enough with the math to be sure what it should do instead.
> >>
> >> Tom
> >>
> >> On Fri, Jul 3, 2015 at 11:41 AM elmar werling
> >> <el...@ne...
> <mailto:el...@ne...>
> >> <mailto:el...@ne...
> <mailto:el...@ne...>>> wrote:
> >>
> >>
> >> Hi all,
> >>
> >> violinplot is crashing with singular matrix data. See example.
> >>
> >> Is this behaviour for a singular matrix intended or just a bug?
> >>
> >> Cheers
> >> Elmar
> >>
> >>
> >>
> >> #####################################################
> >> import numpy as np
> >> import matplotlib.pyplot as plt
> >>
> >> # data mimicing the
> >> # original cumsum data (may sum up to 100)
> >> N = 100
> >> y1 = np.random.randn(N) + 3.0
> >> y2 = np.random.randn(N) * 5.0 + 50
> >> y3 = np.ones(N) * 100 # data set causing violinplot problem
> >>
> >> plt.violinplot([y1, y2, y3])
> >>
> >> plt.boxplot([y1, y2, y3]) # ok
> >> plt.ylim(0,110)
> >>
> >> #####################################################
> >>
> >> OS: Debian
> >> Anaconda 2.3.0 (64-bit)
> >> Python 2.7.10
> >> numpy 2.3.0
> >> matplotlib 1.4.3
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> Don't Limit Your Business. Reach for the Cloud.
> >> GigeNET's Cloud Solutions provide you with the tools and
> support that
> >> you need to offload your IT needs and focus on growing your
> business.
> >> Configured For All Businesses. Start Your Cloud Today.
> >> https://www.gigenetcloud.com/
> >> _______________________________________________
> >> Matplotlib-devel mailing list
> >>
> Mat...@li...
> <mailto:Mat...@li...>
> >>
> <mailto:Mat...@li...
> <mailto:Mat...@li...>>
> >> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
> >>
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> Don't Limit Your Business. Reach for the Cloud.
> >> GigeNET's Cloud Solutions provide you with the tools and support
> that
> >> you need to offload your IT needs and focus on growing your
> business.
> >> Configured For All Businesses. Start Your Cloud Today.
> >> https://www.gigenetcloud.com/
> >>
> >>
> >>
> >> _______________________________________________
> >> Matplotlib-devel mailing list
> >>
> Mat...@li...
> <mailto:Mat...@li...>
> >> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
> >>
> >
> >
> >
> ------------------------------------------------------------------------------
> > Don't Limit Your Business. Reach for the Cloud.
> > GigeNET's Cloud Solutions provide you with the tools and support that
> > you need to offload your IT needs and focus on growing your business.
> > Configured For All Businesses. Start Your Cloud Today.
> > https://www.gigenetcloud.com/
> >
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> Matplotlib-devel mailing list
> Mat...@li...
> <mailto:Mat...@li...>
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
>
>
>
> _______________________________________________
> Matplotlib-devel mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>
From: elmar w. <el...@ne...> - 2015年07月04日 12:58:08
having a look at seaborns ViolinPlotter class 
(https://github.com/mwaskom/seaborn/blob/master/seaborn/categorical.py), 
they explicit handle the special case of "no data" and "single unique 
datapoint" at line 580 ff.
Could something similar be added to matplotlibs violinplot?
On 04.07.2015 12:28, elmar werling wrote:
> from an end user point of view, matplotlibs violinplot should just do
> the same as seaborns violinplot.
>
>
> #####################################################################
> import numpy as np
> import matplotlib.pyplot as plt
> import seaborn as sns
>
> N = 100
> y1 = np.random.randn(N) + 3.0
> y2 = np.random.randn(N) * 5.0 + 50
> y3 = np.ones(N) * 100 # causing plt.violinplot problem
> y4 = np.arange(0) # causing plt.violinplot problem
>
> #plt.violinplot([y1, y2, y3, y4])
>
> sns.violinplot(data=[y1, y2, y3, y4])
>
>
> On 03.07.2015 17:52, Thomas Caswell wrote:
>> The KDE computation code is a copy of the KDE code from scipy
>> (https://github.com/scipy/scipy/blob/master/scipy/stats/kde.py), I
>> suggest raising this issue on their mailing list/github.
>>
>> I strongly suspect that violin plot should be doing data sanitation on
>> the way in or catching exceptions like this, but I am not familiar
>> enough with the math to be sure what it should do instead.
>>
>> Tom
>>
>> On Fri, Jul 3, 2015 at 11:41 AM elmar werling
>> <el...@ne...
>> <mailto:el...@ne...>> wrote:
>>
>>
>> Hi all,
>>
>> violinplot is crashing with singular matrix data. See example.
>>
>> Is this behaviour for a singular matrix intended or just a bug?
>>
>> Cheers
>> Elmar
>>
>>
>>
>> #####################################################
>> import numpy as np
>> import matplotlib.pyplot as plt
>>
>> # data mimicing the
>> # original cumsum data (may sum up to 100)
>> N = 100
>> y1 = np.random.randn(N) + 3.0
>> y2 = np.random.randn(N) * 5.0 + 50
>> y3 = np.ones(N) * 100 # data set causing violinplot problem
>>
>> plt.violinplot([y1, y2, y3])
>>
>> plt.boxplot([y1, y2, y3]) # ok
>> plt.ylim(0,110)
>>
>> #####################################################
>>
>> OS: Debian
>> Anaconda 2.3.0 (64-bit)
>> Python 2.7.10
>> numpy 2.3.0
>> matplotlib 1.4.3
>>
>>
>> ------------------------------------------------------------------------------
>> Don't Limit Your Business. Reach for the Cloud.
>> GigeNET's Cloud Solutions provide you with the tools and support that
>> you need to offload your IT needs and focus on growing your business.
>> Configured For All Businesses. Start Your Cloud Today.
>> https://www.gigenetcloud.com/
>> _______________________________________________
>> Matplotlib-devel mailing list
>> Mat...@li...
>> <mailto:Mat...@li...>
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Don't Limit Your Business. Reach for the Cloud.
>> GigeNET's Cloud Solutions provide you with the tools and support that
>> you need to offload your IT needs and focus on growing your business.
>> Configured For All Businesses. Start Your Cloud Today.
>> https://www.gigenetcloud.com/
>>
>>
>>
>> _______________________________________________
>> Matplotlib-devel mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>>
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /