New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
width = max([len(line) for c in self._content for line in c]) No content in figure #43
Comments
Cannot reproduce:
|
I have the same issue
|
Please make your code copy-pastable. |
import termplotlib as tpl
import numpy
x = numpy.linspace(0, 2 * numpy.pi, 10)
y = numpy.sin(x)
fig = tpl.figure()
fig.plot(x, y, label="data", width=50, height=15)
fig.show() |
@rockt This is literally the same thing that OP posted. 👎 |
Indeed, even better: it's the example from the project's README. The reason I commented on this issue is for you to see additional information on the error that both @hudengjunai and I get. |
Like I said: I cannot reproduce it, so I have no way of fixing it. PRs welcome! |
having the same issue with Python 3.7.6 |
The sourcecode in the github repository is not identical to the sourcecode installed by pip. if self._width is None:
line_lengths = [len(line) for c in self._content for line in c]
width = max(line_lengths) if line_lengths else 0
width += padding_lr in the pip install it is: if self._width is None:
width = max([len(line) for c in self._content for line in c])
width += padding_lr This removes the check for empty content. Fixing this still doesn't make it create a plot, but it removes the error message. I suspect there is another discrepancy somewhere. |
I pushed a new version (0.3.3) to pypi, and since I cannot reproduce the issue, I'll assume it's fixed somehow. Please reopen if this doesn't work for you. |
after run this piece of code ,there are error ,
did you come up with this problem?
The text was updated successfully, but these errors were encountered: