Hi,

I tried to learn the ggplot package in Sage 6.3 as follows.

ggplot(mtcars, aes('factor(cyl)')) does not work.

Would you show me how to resolve this problem ?

Thanks,
Yoshihiro Sato
----------------------------
Sage Version 6.3, Release Date: 2014-08-10 

from ggplot import *

# geom_bar example
p = ggplot(mtcars, aes('factor(cyl)'))
p + geom_bar()
  
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_14.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 
-*-\\n" + 
_support_.preparse_worksheet_cell(base64.b64decode("IyBnZW9tX2JhcuOBruS+iwpwID0gZ2dwbG90KG10Y2FycywgYWVzKCdmYWN0b3IoY3lsKScpKQpwICsgZ2VvbV9iYXIoKQ=="),globals())+"\\n");
 
execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File 
"/private/var/folders/58/d5_2tdvd2tb8hz_nz4rgwzx00000gn/T/tmpvszv_S/___code___.py",
 
line 3, in <module>
    p = ggplot(mtcars, aes('factor(cyl)'))
  File 
"/Applications/Sage-6.3.app/Contents/Resources/sage/local/lib/python2.7/site-packages/ggplot-0.6.6-py2.7.egg/ggplot/ggplot.py",
 
line 66, in __init__
    self.data = _apply_transforms(data, self.aesthetics)
  File 
"/Applications/Sage-6.3.app/Contents/Resources/sage/local/lib/python2.7/site-packages/ggplot-0.6.6-py2.7.egg/ggplot/ggplot.py",
 
line 553, in _apply_transforms
    raise Exception(msg % (ae, name, str(e)))
Exception: Could not evaluate the 'x' mapping: 'factor(cyl)' (original 
error: unable to factor n)
-----------------------------

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to