{"id":17113007,"url":"https://github.com/emmt/yplot.jl","last_synced_at":"2026-02-09T21:07:02.164Z","repository":{"id":71510291,"uuid":"97583884","full_name":"emmt/YPlot.jl","owner":"emmt","description":"Simplified interface for plotting with Julia","archived":false,"fork":false,"pushed_at":"2024-07-10T21:13:12.000Z","size":19,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T05:41:20.500Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","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/emmt.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-18T10:09:02.000Z","updated_at":"2024-07-10T21:13:14.000Z","dependencies_parsed_at":"2024-07-08T12:22:56.401Z","dependency_job_id":null,"html_url":"https://github.com/emmt/YPlot.jl","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FYPlot.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FYPlot.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FYPlot.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emmt%2FYPlot.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emmt","download_url":"https://codeload.github.com/emmt/YPlot.jl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245177259,"owners_count":20573071,"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":[],"created_at":"2024-10-14T17:02:18.006Z","updated_at":"2026-02-09T21:07:02.139Z","avatar_url":"https://github.com/emmt.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# YPlot.jl\n\nA very simple plotting package for Julia. For now, the back-end is\n[PythonPlot](https://github.com/JuliaPy/PythonPlot.jl), the syntax is somewhat reminiscent\nof Yorick.\n\nThe initial objective was to cope with the displaying 2D Julia arrays with axes\norientation and extent suitable for **matrix** (that is `A[i,j]` is indexed by *row* `i`\nand *column* `j`) or **image** (that is `A[x,y]` is indexed by *abscissa* index `x` and\n*ordinate* index `y`) conventions.\n\nExample:\n\n```julia\nusing YPlot\nA = reshape(1:12, 3, 4);\nplmat(A, \"Plotting A[i,j] as a matrix\", \"i (row index)\", \"j (column index)\"; fig=1)\nplimg(A, \"Plotting A[x,y] as an image\", \"x\", \"y\"; cbar=true, fig=2)\n```\n\nwill display the 2D array 4×7 array `A` as a matrix in figure 1 and as an image (with a\ncolor bar) in figure 2.\n\nArray may also have offsets:\n\n```julia\nusing YPlot, OffseArrays\nA = OffsetArray(reshape(1:12, 3, 4), -2:0, -1:2);\nplmat(A, \"Plotting A[i,j] as a matrix\", \"i (row index)\", \"j (column index)\"; fig=1)\nplimg(A, \"Plotting A[x,y] as an image\", \"x\", \"y\"; fig=2)\n```\n\n\n## Wish List\n\n* Add a database of preferences (using a dictionary) which can be optionally saved to the\n  disk. The back-end should be part of the preferences.\n\n* Add `plc` for plotting contours.\n\n\n## Installation\n\n```julia\nusing Pkg\nPkg.add(\"https://github.com/emmt/YPlot.jl\")\n```\n\n### Using PyPlot with system MatPlotLib on Ubuntu\n\nWhen installing [PyCall](https://github.com/JuliaPy/PyCall.jl) which is required by\nPyPlot, if environment variable `PYTHON` is set to an empty string, a custom Python\ninstallation based on [Conda.jl](https://github.com/Luthaf/Conda.jl) is installed. This\ncan take quite a bit of disk space (4-5 Gb in my case per version of Julia) and you may\nprefer to use a version of MatPlotLib already installed on your system. I explain below\nhow to do that on [Ubuntu](https://www.ubuntu.com/) (or similar like\n[Linux-Mint](https://linuxmint.com/)) Linux distribution.\n\n***Important*** As of Julia 1.0 and PyPlot 2.2.2, interaction with Python3 is broken (it\nfreezes the REPL until mouse moves into the graphic window) and Gtk3Agg backend is broken\nwith Python2.7 even with the `python-cairocffi` Debian package (error message: *TypeError:\nCouldn't find foreign struct converter for 'cairo.Context'*). Hence, my recommendation is\nto **use Python 2.7 with Qt5Agg or Tk frontends**. Perhaps Qt4Agg or WXAgg work but I did\nnot tried.\n\nInstall packages (depending on which version of Python you want to use, the two can\ncoexist but see my recommendations above):\n\n```sh\nsudo apt-get install python-matplotlib libpython-dev python-pyqt5\n```\n\nor\n\n```sh\nsudo apt-get install python3-matplotlib libpython3-dev python3-pyqt5\n```\n\ndepending on which version of Python you want to use.\n\nInstead of `python-pyqt5` (resp. `python3-pyqt5`), alternative Debian packages are\n`python-qt4` (resp. `python3-pyqt4`) for using with QT4 toolkit and/or `python-tk` (resp.\n`python3-tk`) to use Tcl/Tk. The `*-dev` packages are needed to have symbolic links\n`libpython*.so` in `/usr/lib/x86_64-linux-gnu`. If symbolic links `libpython*.so` do not\nexists in `/usr/lib`, create them (needed for `PyCall` build to find the Python library):\n\n```sh\ncd /usr/lib\nsudo ln -s x86_64-linux-gnu/libpython*.so .\n```\n\nNow, in Julia install PyCall and PyPlot (see\n[here](https://stackoverflow.com/questions/16675865/difference-between-python3-and-python3m-executables)\nfor the different Python versions on Ubuntu):\n\n```julia\nENV[\"PYTHON\"] = \"/usr/bin/python2.7\" # or \"/usr/bin/python3.6m\" or \"/usr/bin/python3.6\"\nENV[\"MPLBACKEND\"] = \"Qt5Agg\"\nusing Pkg\nPkg.add(\"PyCall\")\nPkg.add(\"PyPlot\")\n```\n\nYou can also define `ENV[\"PYTHON\"]` and `ENV[\"MPLBACKEND\"]` in `~/.juliarc.jl` or in\n`~/.Julia/config/startup.jl` (depending on Julia version) to start Julia with the correct\nPython path and MatPlotLib backend.\n\nMy own `~/.Julia/config/startup.jl` has the following lines:\n\n```julia\nENV[\"PYTHON\"] = \"/usr/bin/python2.7\"\nENV[\"MPLBACKEND\"] = \"Qt5Agg\"\n```\n\nIf you change `ENV[\"PYTHON\"]`, re-build PyCall. Remember that defining `ENV[\"PYTHON\"]=\"\"`,\nwill install a custom Conda environment (which may be huge, 4-5 Gb for me). If you change\n`ENV[\"MPLBACKEND\"]`, just restart Julia (or make the change before your first\n`import`/`using` of PyPlot).\n\nIn case of problems, to check which backend you are using:\n\n```julia\nusing PyPlot\nPyPlot.backend # yields backend name\nPyPlot.gui     # yields toolkit name\n```\n\nMatPlotLib backends (see file `init.jl` in `PyPlot/src` directory, \"*Agg*\" means\nanti-aliasing and case does not matter) are:\n\n* WX, WXAgg\n* GTK, GTKAgg, GTKCairo\n* GTK3, GTK3Agg, GTK3Cairo\n* Qt4Agg, QT5Agg\n* TkAgg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmt%2Fyplot.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femmt%2Fyplot.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femmt%2Fyplot.jl/lists"}