2

I am very new to ggplot. I am trying to create a dotplot in this fashion.

https://stackoverflow.com/a/20621581/229075

I don't have much luck so far. My trial below

df=DataFrame({'label':['a', 'b', 'c'], 
              'value':[7, 2, 4]})
ggplot(aes(x="value", y="label"), df) + geom_point()

Gives me this error

C:\Anaconda\lib\site-packages\numpy\core\numeric.pyc in 
           asanyarray(a, dtype, order)
    510 
    511     """
--> 512     return array(a, dtype, copy=False, order=order, subok=True)
    513 
    514 def ascontiguousarray(a, dtype=None):

ValueError: could not convert string to float: a

I've lookup some a number of docs on R's ggplot. I also have some trouble using construct such as

stat="identity"
coord_flip()
geom_bar(weight=?)

Are these not yet implemented?

I have Python ggplot version 0.5.0.

kjetil b halvorsen
  • 1,206
  • 2
  • 18
  • 28
Wai Yip Tung
  • 18,106
  • 10
  • 43
  • 47
  • ggplot-python is currnetly not so far as the r ggplot2, so some things don't work. In the above we seem to miss that using a string variable as y needs to be converted to something which matplotlib understands (and not blindingly using it as numbers). – Jan Katins Apr 11 '14 at 06:53
  • For the rest: stat="identity" is currently worked on https://github.com/yhat/ggplot/pull/266, coords are totaly not supported right now. Not sure about he `geom_bar(weight)` thingy, could happen that we missed something there. All of this would benefit from some bugreports (and PRs) on github :-) – Jan Katins Apr 11 '14 at 06:55
  • Sure. I wasn't sure if I have used it correctly. Will file the issues in Github. – Wai Yip Tung Apr 11 '14 at 20:19

0 Answers0