plot freeze
alekin2 opened this issue · 8 comments
On windows 10, python 3.10, pycharm Build #PC-231.9161.41, built on June 20, 2023
After
import numpy as np
from distfit import distfit
X = np.random.normal(0, 2, 10000)
y = [-8,-6,0,1,2,3,4,5,6]
Initialize
dfit = distfit(alpha=0.01)
Fit
dfit.fit_transform(X)
Plot seperately
fig, ax = dfit.plot(chart='pdf')
I get a blank plot freezed!
I can't resize or other. If I close plot I get:
Process finished with exit code -805306369 (0xCFFFFFFF)
Also other plot
fig, ax = dfit.plot(chart='cdf', n_top=11)
freeze
Thank you for mentioning this. I can not reproduce the error.
Have you tried to create a new environment first?
Also when you install distfit, force to download the latest version. Should be 1.6.10
import distfit
distfit.__version__
conda create -n env_test python=3.10
conda activate env_test
pip install -U distfit
import numpy as np
from distfit import distfit
import matplotlib.pyplot as plt
X = np.random.normal(0, 2, 10000)
y = [-8,-6,0,1,2,3,4,5,6]
dfit = distfit(alpha=0.01)
dfit.fit_transform(X)
fig, ax = dfit.plot(chart='pdf')
fig, ax = dfit.plot(chart='cdf', n_top=11)
plt.show()
# Or
fig.show()
C:\Users\Massimo>pip install distfit --upgrade
Defaulting to user installation because normal site-packages is not writeable
Collecting distfit
Downloading distfit-1.6.10-py3-none-any.whl (40 kB)
---------------------------------------- 40.4/40.4 kB ? eta 0:00:00
Requirement already satisfied: scipy in c:\programdata\anaconda3\lib\site-packages (from distfit) (1.10.0)
Requirement already satisfied: pandas in c:\programdata\anaconda3\lib\site-packages (from distfit) (1.5.3)
Requirement already satisfied: tqdm in c:\programdata\anaconda3\lib\site-packages (from distfit) (4.64.1)
Requirement already satisfied: numpy in c:\users\massimo\appdata\roaming\python\python310\site-packages (from distfit) (1.25.0)
Collecting pypickle
Downloading pypickle-1.1.0-py3-none-any.whl (5.1 kB)
Collecting colourmap>=1.1.10
Downloading colourmap-1.1.14-py3-none-any.whl (9.2 kB)
Requirement already satisfied: packaging in c:\programdata\anaconda3\lib\site-packages (from distfit) (22.0)
Requirement already satisfied: statsmodels in c:\programdata\anaconda3\lib\site-packages (from distfit) (0.13.5)
Requirement already satisfied: matplotlib>=3.5.2 in c:\programdata\anaconda3\lib\site-packages (from distfit) (3.7.0)
Requirement already satisfied: pyparsing>=2.3.1 in c:\programdata\anaconda3\lib\site-packages (from matplotlib>=3.5.2->distfit) (3.0.9)
Requirement already satisfied: kiwisolver>=1.0.1 in c:\programdata\anaconda3\lib\site-packages (from matplotlib>=3.5.2->distfit) (1.4.4)
Requirement already satisfied: cycler>=0.10 in c:\programdata\anaconda3\lib\site-packages (from matplotlib>=3.5.2->distfit) (0.11.0)
Requirement already satisfied: pillow>=6.2.0 in c:\programdata\anaconda3\lib\site-packages (from matplotlib>=3.5.2->distfit) (9.4.0)
Requirement already satisfied: fonttools>=4.22.0 in c:\programdata\anaconda3\lib\site-packages (from matplotlib>=3.5.2->distfit) (4.25.0)
Requirement already satisfied: contourpy>=1.0.1 in c:\programdata\anaconda3\lib\site-packages (from matplotlib>=3.5.2->distfit) (1.0.5)
Requirement already satisfied: python-dateutil>=2.7 in c:\programdata\anaconda3\lib\site-packages (from matplotlib>=3.5.2->distfit) (2.8.2)
Requirement already satisfied: pytz>=2020.1 in c:\programdata\anaconda3\lib\site-packages (from pandas->distfit) (2022.7)
Requirement already satisfied: patsy>=0.5.2 in c:\programdata\anaconda3\lib\site-packages (from statsmodels->distfit) (0.5.3)
Requirement already satisfied: colorama in c:\programdata\anaconda3\lib\site-packages (from tqdm->distfit) (0.4.6)
Requirement already satisfied: six in c:\programdata\anaconda3\lib\site-packages (from patsy>=0.5.2->statsmodels->distfit) (1.16.0)
Installing collected packages: pypickle, colourmap, distfit
Successfully installed colourmap-1.1.14 distfit-1.6.10 pypickle-1.1.0
The update doesn't fix it. ... but with environment (argh!!) works!!!
I removed env_test and retried the code from cmd. Works! the problem occurs if you run the script from python console of pycharm Build #PC-231.9161.41, built on June 20, 2023
Happy to hear that your issue is solved!
I am not sure whether/how I can tackle this issue in the code. Maybe the most practical manner is to create a new page in the documentation that describes that some versions of pycharm can result in an error.
info: When I run plt.show() in pycharm debug mode, other scripts, not related to this library, also fail, because the graph freezes.
Perhaps the problem is related
thanks for letting know
Is this still an issue? Or did time heal something over here?