You need to import aes
:
from ggplot import aes
Alternatively, you can just import everything in the ggplot
namespace (though *
imports are usually frowned upon as they make it difficult to track down where a name is coming from):
from ggplot import *