
A new ggplot is here - avyfain
http://blog.yhat.com/posts/new-ggplot.html
======
quantumtremor
> aes(x='np.log(B - A)')

I never understood the pattern of putting source code in a string. Why not
just use np.log(B - A) directly and configure the function to accept columns?
With strings you lose highlighting, semantic analysis from editors, as well as
the ability to know what computations are happening when and where. There
seems to be no point and significant drawback to this, what's the rationale?

~~~
minimaxir
That is likely a hack necessary for it to work with Python syntax. (R's
ggplot2 does not require wrapping aesthetics in strings)

~~~
Bootvis
Indeed, whereas function arguments in R are lazily evaluated in Python they're
not.

~~~
quantumtremor
But is laziness that important for a graphing library where presumably you'd
be graphing the function anyway? I guess there are some cases where one of the
other options would disable the y-axis or something, but this seems pretty
rare. Is there another reason?

~~~
Someone
I'm not sure whether this library supports it, but if you plot a _function_ ,
a smart plotting library will evaluate the function at points that depend on
the function and the resolution of your output device; you can't just evaluate
the function at n points on the to be plotted range and expect to get an
accurate plot.

For example, to plot _sin(1 /x)_ accurately, it must be evaluated many, many
times near zero, but you do not want to do that further away from the origin,
as it slows down plotting, and can produce less nice plots if you export to a
vector format such as svg or postscript.

------
minimaxir
Important clarification: this refers to the Python port of ggplot2, not the R
package itself.

~~~
FiReaNG3L
I really think they should get another name, it's confusing for no real gain,
especially if they intend to go their own way. A good grammar-based language
to make plots in python is needed, not sure we need to be restrained by all
the R legacy and quirks.

~~~
alecdbrooks
To be fair, there is some precedent. Printf, QuickCheck, and other libraries
and features keep the exact same name as they're copied from language to
language.

------
carlmcqueen
Context would be nice, looked through it baffled until I realized this was a
port of the Grammar of Graphics to Python to work and look exactly like
Hadley's ggplot.

I learned R because of my frustrations where Panda's was years ago, seeing
this kind of port continues to make me think about moving back to Python from
start to finish.

~~~
tanlermin
[https://github.com/dodger487/dplython](https://github.com/dodger487/dplython)
also see this

