{"id":16705577,"url":"https://github.com/mpastell/rpyplot","last_synced_at":"2025-04-10T05:15:12.975Z","repository":{"id":29665594,"uuid":"33207725","full_name":"mpastell/Rpyplot","owner":"mpastell","description":"R interface to matplotlib","archived":false,"fork":false,"pushed_at":"2015-04-13T20:06:53.000Z","size":272,"stargazers_count":13,"open_issues_count":2,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T05:15:07.345Z","etag":null,"topics":["matplotlib","r","rcpp"],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mpastell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-31T20:19:42.000Z","updated_at":"2021-08-07T04:35:57.000Z","dependencies_parsed_at":"2022-09-03T18:40:26.061Z","dependency_job_id":null,"html_url":"https://github.com/mpastell/Rpyplot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpastell%2FRpyplot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpastell%2FRpyplot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpastell%2FRpyplot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mpastell%2FRpyplot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mpastell","download_url":"https://codeload.github.com/mpastell/Rpyplot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248161278,"owners_count":21057555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["matplotlib","r","rcpp"],"created_at":"2024-10-12T19:31:01.214Z","updated_at":"2025-04-10T05:15:12.951Z","avatar_url":"https://github.com/mpastell.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"\r\n# Rpyplot\r\n\r\nR interface to matplotlib via Rcpp using Python 2.7 or 3.\r\n\r\nContains basic working interface to some basic with few options. Tested with Ubuntu 14.10 (System Python 2.7, 3.4) and Windows 7 (Anaconda Python 2.7, 3.4). \r\n\r\n## Why?\r\n\r\nI often use Python and [matplotlib](http://matplotlib.org/) for exploring measurement data (from e.g. accelerometers), even if I use R for the actual analysis. The reason is that I like to be able to flexibly zoom into different parts of the plot using the mouse and this works well for me with matplotlib. So I decided to try to call matplotlib from R using Rcpp and [Python/C API](https://docs.python.org/2/c-api/). It was surprisingly simple to get it working so I put together this package.\r\n\r\n## Install\r\n\r\nInstall using devtools.\r\n\r\n**Ubuntu**\r\n\r\nYou'll need to have Python with headers (python-dev in Ubuntu) and matplotlib:\r\n\r\n\r\n```bash\r\nsudo apt-get install python-dev python-matplotlib\r\n\r\n```\r\n\r\nUse devtools to install from R.\r\n\r\n\r\n```R\r\nlibrary(devtools)\r\ninstall_github(\"mpastell/Rpyplot\")\r\n```\r\n\r\n**Windows**\r\n\r\nYou'll need to have Rtools and Python with matplotlib installed and in your path. You'll also need to have libpythonXX.a in \"$PYTHON\\libs\\\".  You can use [libpython](http://www.lfd.uci.edu/~gohlke/pythonlibs/#libpython) from Christoph Gohlke's repository. Make sure you use the same architecture for R and Python.\r\n\r\n\r\nInstall libpython using pip (the version needs to match the install Python version, the url below is for Python3.4)\r\n\r\n```\r\npip install wheel\r\npip install http://www.lfd.uci.edu/~gohlke/pythonlibs/6icuform/libpython-3.4.3-cp34-none-win_amd64.whl\r\n\r\n```\r\n\r\n```R\r\nlibrary(devtools)\r\ninstall_github(\"mpastell/Rpyplot\", args = \"--no-multiarch\")\r\n```\r\n\r\n\r\n## Use\r\n\r\nTo get started see:\r\n\r\n```R\r\nlibrary(Rpyplot)\r\nexample(pyplot)\r\nexample(pystep)\r\nexample(pycontourf)\r\n```\r\n\r\n## Development \r\n\r\nI developed the package to do quick interactive analysis and its not meant to interface all of pyplot. I will add more features to the package when I need them. If you want add functionality please do so and submit a pull request. You can add new plots and options easily in R (see `R/Plot.R`) without using C++. I have written a post to [Rcpp gallery](http://gallery.rcpp.org/articles/matplotlib-from-R/) that tries to explain the C++ side of the code.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpastell%2Frpyplot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmpastell%2Frpyplot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmpastell%2Frpyplot/lists"}