You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to run the example code provided in the README for the hist function:
import plotext as plt
import random
data = [random.gauss(0, 1) for el in range(50000)]
data2 = [random.gauss(3, 1) for el in range(50000)]
plt.clp()
bins = 60
plt.hist(data, bins, label="mean 0")
plt.hist(data2, bins, label="mean 3")
plt.title("Histogram plot")
plt.xlabel("data bin")
plt.ylabel("frequency")
plt.figsize(100, 30)
plt.show()
I get the following error:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-1-e704a9ff5ccd> in <module>
11 plt.ylabel("frequency")
12 plt.figsize(100, 30)
---> 13 plt.show()
~/anaconda3/envs/pepys_py38/lib/python3.8/site-packages/plotext/plot.py in show()
335 _size_max()
336
--> 337 _height_min()
338 _height()
339
~/anaconda3/envs/pepys_py38/lib/python3.8/site-packages/plotext/plot.py in _height_min()
372 def _height_min():
373 par.height_title = int(par.title != "")
--> 374 par.height_xaxis = int(par.axes[0] or par.frame)
375 par.height_xticks = bool(par.ticks[0])
376 par.height_labels = int(par.xlabel != "" or par.ylabel != "")
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
It seems like par.axes[0] or par.frame aren't initialised properly? Do you have any idea how to fix this?
The text was updated successfully, but these errors were encountered:
thanks for reporting the issue. I have just updated the package and it should work now. Try upgrading to version 2.3.1 (from 2.3.0), possibly using pip install plotext --upgrade.
I hope it helps, but please let me know if not and I will reopen the issue.
Thanks,
Savino
I've been trying to run the example code provided in the README for the hist function:
I get the following error:
It seems like
par.axes[0]
orpar.frame
aren't initialised properly? Do you have any idea how to fix this?The text was updated successfully, but these errors were encountered: