{"id":13477951,"url":"https://github.com/jktr/matplotlib-backend-notcurses","last_synced_at":"2025-03-27T07:30:34.251Z","repository":{"id":57440071,"uuid":"454551353","full_name":"jktr/matplotlib-backend-notcurses","owner":"jktr","description":"show matplotlib plots directly in your terminal","archived":false,"fork":false,"pushed_at":"2023-01-23T17:01:07.000Z","size":27,"stargazers_count":22,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-08T05:38:52.194Z","etag":null,"topics":["matplotlib","notcurses","terminal"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jktr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-01T21:07:02.000Z","updated_at":"2024-12-25T23:29:42.000Z","dependencies_parsed_at":"2023-02-13T01:15:28.527Z","dependency_job_id":null,"html_url":"https://github.com/jktr/matplotlib-backend-notcurses","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jktr%2Fmatplotlib-backend-notcurses","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jktr%2Fmatplotlib-backend-notcurses/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jktr%2Fmatplotlib-backend-notcurses/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jktr%2Fmatplotlib-backend-notcurses/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jktr","download_url":"https://codeload.github.com/jktr/matplotlib-backend-notcurses/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245802131,"owners_count":20674592,"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","notcurses","terminal"],"created_at":"2024-07-31T16:01:50.237Z","updated_at":"2025-03-27T07:30:33.919Z","avatar_url":"https://github.com/jktr.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# matplotlib-backend-notcurses\n\nThis python module allows you to show the plots generated\nby python's [matplotlib](https://github.com/matplotlib/matplotlib)\nin many modern and older terminals by using\n[notcurses](https://github.com/dankamongmen/notcurses/).\n\nTo install it, you will need to do one of the following\n\n - `$ pip install --user matplotlib-backend-notcurses`\n - clone this repo into your python's `site-packages` directory\n - clone this repo and add the parent directory to `sys.path` or `$PYTHONPATH`\n\nThen, configure matplotlib to use the module by either setting the\nenvironment variable `MPLBACKEND` to `module://matplotlib-backend-notcurses`\nor by initializing matplotlib as follows.\n\n```python\nimport matplotlib\nmatplotlib.use('module://matplotlib-backend-notcurses')\nimport matplotlib.pyplot as plt\n```\n\nPlease make sure that you have the programs `ncplayer`\nand `notcurses-info`, both from `notcurses`, in your `PATH`.\n\nIf you've installed this module correctly, you can now use\nthe following sample code to draw a plot in your terminal.\n\n```\n$ export MPLBACKEND='module://matplotlib-backend-notcurses'\n$ python -i\n\u003e\u003e\u003e import numpy as np; import pandas as pd\n\u003e\u003e\u003e n = 10000\n\u003e\u003e\u003e df = pd.DataFrame({'x': np.random.randn(n),\n                       'y': np.random.randn(n)})\n\u003e\u003e\u003e df.plot.hexbin(x='x', y='y', gridsize=20)\n\u003cplot is shown\u003e\n```\n\nIf you set your matplotlib to interactive mode via\n`matplotlib.pyplot.ion()` or by running python as\n`python -i`, non-empty figures are drawn on construction\nwhere possible. This allows you to use pandas' `plot()`\ncalls directly, without calling `plt.show()`, and still\nenables you to manually construct and `plt.show()`.\n\nIf your matplotlib is in non-interactive mode,\nyou can construct your figures as usual, and then call\n`plt.show()` to render them to your terminal. This\nworks from both a repl and when running scripts.\n\nFigures are resized to the size of your terminal by default.\nIf you'd rather control the sizing of figures manually,\nset the `MPLBACKEND_NOTCURSES_SIZING` environment variable to `manual`.\n\nInternally, this backend is somewhat based on matplotlib's\nIPython support: it's a hybrid of image and GUI backend types.\nIt works by using matplotlib's `Agg` backend to render the\nplot, and then calls notcurses's `ncplayer` to place the rendered\nimage on your terminal. This means that plotting works as\nexpected, but the image drawn to your terminal isn't\ninteractive and animations aren't supported.\n\nThis is a port of my matplotlib-backend-kitty to notcurses\ntooling, which provides support for more terminal graphics\nprotocols and reasonable auto-detection and fallbacks for these.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjktr%2Fmatplotlib-backend-notcurses","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjktr%2Fmatplotlib-backend-notcurses","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjktr%2Fmatplotlib-backend-notcurses/lists"}