Skip to content
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

geom_hline() does not work: TypeError: unorderable types: float() > NoneType() #597

Open
Make42 opened this issue Mar 3, 2017 · 4 comments · May be fixed by #622
Open

geom_hline() does not work: TypeError: unorderable types: float() > NoneType() #597

Make42 opened this issue Mar 3, 2017 · 4 comments · May be fixed by #622

Comments

@Make42
Copy link

Make42 commented Mar 3, 2017

If I write

from ggplot import *
import matplotlib.pyplot as plt
plt.figure()
ggplot(aes(x='date_hour', y='pageviews'), data=pageviews) + \
    geom_point() +\
    geom_hline(yintercept=[10000])

from the documentation http://ggplot.yhathq.com/docs/geom_hline.html I get the error

Traceback (most recent call last):
  File "/home/user/anaconda2/envs/myenv/lib/python3.5/code.py", line 91, in runcode
    exec(code, self.locals)
  File "<input>", line 3, in <module>
  File "/home/user/anaconda2/envs/myenv/lib/python3.5/site-packages/ggplot/ggplot.py", line 116, in __repr__
    self.make()
  File "/home/user/anaconda2/envs/myenv/lib/python3.5/site-packages/ggplot/ggplot.py", line 636, in make
    layer.plot(ax, facetgroup, self._aes, **kwargs)
  File "/home/user/anaconda2/envs/myenv/lib/python3.5/site-packages/ggplot/geoms/geom_hline.py", line 36, in plot
    ax.axhline(y, **params)
  File "/home/user/anaconda2/envs/myenv/lib/python3.5/site-packages/matplotlib/axes/_axes.py", line 722, in axhline
    scaley = (yy < ymin) or (yy > ymax)
TypeError: unorderable types: float() > NoneType()

My ggplot is installed with anaconda on python 3.5 from conda-forge and it's version is 0.11.5. Installed with https://anaconda.org/conda-forge/ggplot

What do I do?

@kljensen
Copy link

kljensen commented Mar 8, 2017

@Make42 the documentation is incorrect. See #545 and

y = self.params.get('y')
. You should give geom_hline a parameter y, not yintercept

@Make42
Copy link
Author

Make42 commented Mar 23, 2017

@kljensen Are you able to correct the documentation then? Or who is?

@kljensen
Copy link

@Make42 you can edit the gh-pages branch of this repo and submit a pull request

@vm-asd2015
Copy link

@kljensen Can you show me the file in gh-pages (or another branch/repo) that generates http://ggplot.yhathq.com/docs/geom_vline.html ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants