{"id":13586351,"url":"https://github.com/daleroberts/itermplot","last_synced_at":"2025-05-15T05:08:06.980Z","repository":{"id":43055758,"uuid":"78607774","full_name":"daleroberts/itermplot","owner":"daleroberts","description":"An awesome iTerm2 backend for Matplotlib, so you can plot directly in your terminal.","archived":false,"fork":false,"pushed_at":"2023-06-06T13:11:08.000Z","size":4247,"stargazers_count":1497,"open_issues_count":25,"forks_count":47,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-04-14T08:13:41.230Z","etag":null,"topics":["command-line","iterm2","matplotlib","plot","python","visualization"],"latest_commit_sha":null,"homepage":"","language":"Python","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/daleroberts.png","metadata":{"files":{"readme":"README","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,"governance":null}},"created_at":"2017-01-11T06:01:01.000Z","updated_at":"2025-02-24T01:48:39.000Z","dependencies_parsed_at":"2022-08-21T19:20:29.536Z","dependency_job_id":null,"html_url":"https://github.com/daleroberts/itermplot","commit_stats":{"total_commits":64,"total_committers":8,"mean_commits":8.0,"dds":0.15625,"last_synced_commit":"e8427ce87b0d74e18e14d8c092a01696c17b4c3e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daleroberts%2Fitermplot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daleroberts%2Fitermplot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daleroberts%2Fitermplot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daleroberts%2Fitermplot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daleroberts","download_url":"https://codeload.github.com/daleroberts/itermplot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254276447,"owners_count":22043867,"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":["command-line","iterm2","matplotlib","plot","python","visualization"],"created_at":"2024-08-01T15:05:30.131Z","updated_at":"2025-05-15T05:08:01.969Z","avatar_url":"https://github.com/daleroberts.png","language":"Python","readme":"itermplot\n=========\n\nAn awesome `iTerm2 \u003chttps://www.iterm2.com/\u003e`__ backend for Matplotlib,\nso you can plot directly in your terminal.\n\nThe above is achieved with zero modifications to your Python script. For\nexample, the above plots are generated with the following code:\n\n.. code:: {python}\n\n   import numpy as np\n   import matplotlib.pyplot as plt\n   import networkx as nx\n\n   plt.rcParams[\"font.size\"] = 10\n\n   plt.figure(figsize=(8,3))\n\n   ax = plt.subplot(121)\n   x = np.arange(0,10,0.001)\n   ax.plot(x, np.sin(np.sinc(x)), 'r', lw=2)\n   ax.set_title('Nice wiggle')\n\n   ax = plt.subplot(122)\n   plt.tick_params(axis='both', left='off', top='off', right='off', bottom='off', labelleft='off', labeltop='off', labelright='off', labelbottom='off')\n   G = nx.random_geometric_graph(200, 0.125)\n   pos=nx.spring_layout(G)\n   nx.draw_networkx_edges(G, pos, alpha=0.2)\n   nx.draw_networkx_nodes(G, pos, node_color='r', node_size=12)\n   ax.set_title('Random graph')\n\n   plt.show()\n\nNote: you need to run ``plt.show()`` to display the figure.\n\nReverse video\n~~~~~~~~~~~~~\n\nIf you use a dark background in your terminal, you can enable “reverse\nvideo” mode by adding this to your ``.profile``:\n\n::\n\n   export ITERMPLOT=rv\n\nTMUX support\n~~~~~~~~~~~~\n\nitermplot tries to auto-detect TMUX and behave in a sane way. Vertical\nsplit panes do not work well due to a limitation with iTerm2. Luckily,\nhorizontals do though.\n\nAnimation support\n~~~~~~~~~~~~~~~~~\n\nitermplot supports animation created by matplotlib animation module.\n\nYou’ll need to install ImageMagick and have it on the path to use the\nanimation support. The simplest way to see if ImageMagick is installed\nand valid is to run:\n\n.. code:: {sh}\n\n   $ convert -version\n   Version: ImageMagick 7.0.4-4 Q16 x86_64 2017-01-14 http://www.imagemagick.org\n   Copyright: © 1999-2017 ImageMagick Studio LLC\n   License: http://www.imagemagick.org/script/license.php\n   Features: Cipher DPC HDRI Modules\n   Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib\n\nTo enable animation support, you need to specifying the desired number\nof frames in the output animation. For example, specify it before your\nscript with:\n\n::\n\n   $ ITERMPLOT_FRAMES=30 python script.py\n\nYou can also save the resulting gif file by using ``ITERMPLOT_OUTFILE``\nenvironment variable:\n\n::\n\n   $ ITERMPLOT_FRAMES=30 ITERMPLOT_OUTFILE=out.gif python script.py\n\nCurrently animation does not support reverse video with ITERMPLOT=rv.\n\nConfigure lines\n~~~~~~~~~~~~~~~\n\nYou can configure the number of lines used with the ``ITERMPLOT_LINES``\nenvironment variable. For example:\n\n.. code:: {sh}\n\n   ITERMPLOT_LINES=5 python3 simple.py\n\nPython 2 and Python 3 support\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nNow supports Python 2, even if this makes me want to cry 😭\n\nInstallation\n------------\n\nUsing pip\n~~~~~~~~~\n\nInstall using ``pip`` using the command:\n\n.. code:: {sh}\n\n   pip3 install itermplot\n\nitermplot is enabled by setting ``MPLBACKEND`` in your environment. If\nyou use ``bash``, then this can be accomplished using the command:\n\n.. code:: {sh}\n\n   export MPLBACKEND=\"module://itermplot\"\n\nNote: you can add the ``export`` line above to your ``.profile`` file so\nthat itermplot is always enabled in your terminal.\n\nTesting\n~~~~~~~\n\nTo test your installation you can do the following in your iTerm2\nconsole:\n\n::\n\n   $ echo $MPLBACKEND\n   module://itermplot\n   $ python3\n   Python 3.5.2 (default, Oct 24 2016, 09:14:06)\n   [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin\n   Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n   \u003e\u003e\u003e import matplotlib.pyplot as plt\n   \u003e\u003e\u003e plt.plot([1,2,3])\n   [\u003cmatplotlib.lines.Line2D object at 0x1041f2e48\u003e]\n   \u003e\u003e\u003e plt.show()\n\nYou should see a plot!\n\nUninstall\n---------\n\nYou can disable this backend by unsetting the ``MPLBACKEND`` environment\nvariable.\n\n::\n\n   $ unset MPLBACKEND\n   $ echo $MPLBACKEND\n\n   $ python3\n   Python 3.5.2 (default, Oct 24 2016, 09:14:06)\n   [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin\n   Type \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n   \u003e\u003e\u003e import matplotlib.pyplot as plt\n   \u003e\u003e\u003e plt.plot([1,2,3])\n   [\u003cmatplotlib.lines.Line2D object at 0x1106bdcc0\u003e]\n   \u003e\u003e\u003e plt.show()\n\nTo remove the package completely, run:\n\n::\n\n   pip3 uninstall itermplot\n\nBugs\n----\n\nThis backend is very alpha, so if you have a problem please raise an\nIssue on GitHub and I will try to fix it.\n\nI also accept (and appreciate!) good patches / pull request. Thanks to\n`garrywu \u003chttps://github.com/garywu\u003e`__,\n`brenshanny \u003chttps://github.com/brenshanny\u003e`__,\n`hbredin \u003chttps://github.com/hbredin\u003e`__,\n`zevlg \u003chttps://github.com/zevlg\u003e`__ for their patches so far.\n\nOther cool things\n-----------------\n\nI encourage you to check-out some of my `other little\nprojects \u003chttps://github.com/daleroberts\u003e`__. Lots more coming as I\nslowly release them…\n","funding_links":[],"categories":["Data Visualization and Graph Making","Python","Computational","macOS"],"sub_categories":["Data Visualization","Neat python"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaleroberts%2Fitermplot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaleroberts%2Fitermplot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaleroberts%2Fitermplot/lists"}