5

My question is as simple as the title: i want to use R's ggplot2 but all my data handling is done in Python: is there a Python API for ggplot2, or an easy way to use ggplot2 through Python ?

Eduard Florinescu
  • 16,747
  • 28
  • 113
  • 179
ruben baetens
  • 2,806
  • 6
  • 25
  • 31

4 Answers4

5

Check this out: https://github.com/yhat/ggplot

This is a python port of R's ggplot2.

Randy Lai
  • 3,084
  • 2
  • 22
  • 23
2

RPy allows you to call R from Python and provides with data conversion utilities. You can use ggplot2 function with the Graphics package, look at this section for some examples.

papirrin
  • 2,004
  • 22
  • 30
2

Great answers so far, but don't forget about Bokeh: https://bokeh.org/

All sorts of great ways to visualize data, emulating ggplot2 in some ways, but also inspired by the amazing D3.js library.

Ever wanted to make something like this in Python?

viz

Here's the quickstart guide: http://docs.bokeh.org/docs/quickstart.html#quickstart

bigreddot
  • 33,642
  • 5
  • 69
  • 122
Danny
  • 625
  • 2
  • 8
  • 11
1

You can use RPy to call R from within python or there is ggplot for python if you do not like matplotlib.

Steve Barnes
  • 27,618
  • 6
  • 63
  • 73