0

Following this simple example, I am trying to make a dirt simple bar chart using yhat's ggplot python module. Here is the code suggested previously on StackOverflow:

In [1]:
from ggplot import *
import pandas as pd
df = pd.DataFrame({"x":[1,2,3,4], "y":[1,3,4,2]})
ggplot(aes(x="x", weight="y"), df) + geom_bar()

But I get an error:

Out[1]:
<repr(<ggplot.ggplot.ggplot at 0x104b18ad0>) failed: UnboundLocalError: local variable 'ax' referenced before assignment>
1
  • The thing about python-ggplot is it's still quite early in development. You can try upgrading to the latest version, which does seem to output something resembling a bar chart, but it still doesn't seem quite right. Commented Aug 15, 2014 at 23:16

1 Answer 1

0

This works a newer version of ggplot-python. It's not that pretty (x-axis labels), we really have to work on that :-(

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.