Gg2plot is an amazing library to plot and it’s available for R to create stunning graphs. GGplot2 takes a different approach from the classic library, and instead of offering a classic line/points approach permits to combine these elements (example), which is a similar root took by D3js. If you are using the scientific python stack (matplotlib, numpy, scipy, ipython) you have the very good matplotlib to plot and have all your graph app.
For example a bunch of sin and cosine generated by the following code:
https://gist.github.com/mattions/5330631
look like this:
Instead if we set up a ggplot2 style, the graph looks like this:
You may prefer one or the other. Anyway if you like the last one, just download this matplotlibrc and save it as ~/.matplotlib/matplotlibrc
, and all your graph will have that style as default.
The matplotlibrc has been inspired by this post, I’ve just updated with the latest matplotlibrc from matplotlib 1.2.1 version.
Have fun!
Edit: Bonus plot, code in the gist.
September 16, 2013 at 4:09 pm
How would you update the matplotlib rcParams in a specific plotting script to change the size of the xtick labels for example. I can’t seem to override the params once I have installed the matplotlibrc file you have provided.
September 16, 2013 at 4:17 pm
The rcParams are loaded as dictionary
import matplotlib
matplotlib.rcParams # dictionary with all the rcParams.
however, if you need to change the ticks for only one plot, maybe you can use plt.xticks or similar to achieve your goal.