{"id":18408672,"url":"https://github.com/h2oai/nitro-matplotlib","last_synced_at":"2025-04-07T09:33:00.275Z","repository":{"id":62591834,"uuid":"497735099","full_name":"h2oai/nitro-matplotlib","owner":"h2oai","description":"Matplotlib plugin for H2O Nitro","archived":false,"fork":false,"pushed_at":"2025-03-17T07:38:08.000Z","size":549,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":40,"default_branch":"main","last_synced_at":"2025-03-22T16:02:43.019Z","etag":null,"topics":["apps","charting-library","charts","data-visualization","h2o-nitro","matplotlib","plugin","python","visualization"],"latest_commit_sha":null,"homepage":"https://nitro.h2o.ai/plugins/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/h2oai.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-05-29T23:48:04.000Z","updated_at":"2025-03-17T07:38:07.000Z","dependencies_parsed_at":"2023-01-22T03:24:25.066Z","dependency_job_id":null,"html_url":"https://github.com/h2oai/nitro-matplotlib","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h2oai%2Fnitro-matplotlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h2oai%2Fnitro-matplotlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h2oai%2Fnitro-matplotlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/h2oai%2Fnitro-matplotlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/h2oai","download_url":"https://codeload.github.com/h2oai/nitro-matplotlib/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247626512,"owners_count":20969317,"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":["apps","charting-library","charts","data-visualization","h2o-nitro","matplotlib","plugin","python","visualization"],"created_at":"2024-11-06T03:20:24.971Z","updated_at":"2025-04-07T09:32:59.790Z","avatar_url":"https://github.com/h2oai.png","language":"Python","readme":"# Matplotlib plugin for H2O Nitro\n\nThis plugin lets you use [Matplotlib](https://matplotlib.org/stable/index.html)\nand [Seaborn](https://seaborn.pydata.org/) visualizations in [Nitro](https://github.com/h2oai/nitro) apps.\n\n**Warning: Try to avoid pyplot in web apps!** pyplot maintains references to the opened figures to make show() work, but\nthis will cause memory leaks unless the figures are properly closed[^1].\n\n[^1]: See [Matplotlib docs on embedding](https://matplotlib.org/3.5.0/gallery/user_interfaces/web_application_server_sgskip.html)\n\n## Demo\n\n### Matplotlib\n\n![Matplotlib](demo_matplotlib.gif)\n\n[View source](examples/matplotlib_basic.py).\n\n### Seaborn\n\n![Seaborn](demo_seaborn.gif)\n\n[View source](examples/seaborn_basic.py).\n\n\n## Install\n\n```\npip install h2o-nitro-matplotlib\n```\n\n## Usage\n\n1. Import the plugin:\n\n\n```py\nfrom h2o_nitro_matplotlib import matplotlib_plugin, matplotlib_box\n```\n\n\n2. Register the plugin:\n\n```py\nnitro = View(main, title='My App', caption='v1.0', plugins=[matplotlib_plugin()])\n```\n\n3. Use the plugin:\n\n```py \n# Make a figure:\nx = np.linspace(0, 2, 100)  # Sample data.\nfig = Figure()\nax = fig.subplots()\nax.plot(x, x, label='linear')  # Plot some data on the axes.\nax.plot(x, x ** 2, label='quadratic')  # Plot more data on the axes...\nax.plot(x, x ** 3, label='cubic')  # ... and some more.\nax.set_xlabel('x label')  # Add an x-label to the axes.\nax.set_ylabel('y label')  # Add a y-label to the axes.\nax.legend()  # Add a legend.\n\n# Display the figure:\nview(matplotlib_box(fig))\n```\n\n## Change Log\n\n- v0.2.1 - Jun 09, 2022\n  - Fixed\n     - Don't return value from plots.\n- v0.2.0 - May 30, 2022\n   - Added\n      - Use global pyplot if a figure is not passed (for Seaborn support).\n- v0.1.0 - May 29, 2022\n  - Initial Version\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh2oai%2Fnitro-matplotlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fh2oai%2Fnitro-matplotlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fh2oai%2Fnitro-matplotlib/lists"}