Is there a way to make matplotlib
behave identically to R, or almost like R, in terms of plotting defaults? For example R treats its axes pretty differently from
Here's a blog post you may be interested to read:
Plotting for Pandas GSoC2012
http://pandasplotting.blogspot.com/
Decided to try to implement a ggplot2 type plotting interface...Not yet sure how much of the ggplot2 functionality to implement...
The author forked pandas and built what looks like quite a lot of ggplot2-style grammar for pandas.
plot = rplot.RPlot(tips_data, x='total_bill', y='tip')
plot.add(rplot.TrellisGrid(['sex', 'smoker']))
plot.add(rplot.GeomHistogram())
plot.render(plt.gcf())
The pandas fork is here: https://github.com/orbitfold/pandas
Seems like meat of the code to make the R-influenced graphics is in a file called rplot.py
which can be found in a branch in the repo.
class GeomScatter(Layer):
"""
An efficient scatter plot, use this instead of GeomPoint for speed.
"""
class GeomHistogram(Layer):
"""
An efficient histogram, use this instead of GeomBar for speed.
"""
Link to the branch:
https://github.com/orbitfold/pandas/blob/rplot/pandas/tools/rplot.py
I thought this was really cool, but I can't figure out if this project is being maintained or not. The last commit was a while ago.