maliang-mpl


Namemaliang-mpl JSON
Version 1.2.3 PyPI version JSON
download
home_pageNone
SummaryExtension package for maliang to matplotlib
upload_time2025-01-13 14:54:03
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT License
keywords tkinter maliang matplotlib cross-platform themed
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 align="center">maliang-mpl</h1>

<p align="center"><a title="Official Website" href="https://xiaokang2022.github.io/tkintertools/">https://xiaokang2022.github.io/tkintertools/</a></p>

<p align="center">Extension package of <code>maliang</code> for <code>matplotlib</code></p>

<p align="center">
<a href="https://github.com/Xiaokang2022/tkintertools-mpl/releases"><img alt="Version" src="https://img.shields.io/github/v/release/Xiaokang2022/tkintertools-mpl?include_prereleases&logo=github&label=Version" title="Latest Version" /></a>
<a href="https://pypistats.org/packages/tkintertools-mpl"><img alt="Downloads" src="https://img.shields.io/pypi/dm/tkintertools-mpl?label=Downloads&logo=pypi&logoColor=skyblue" title="Downloads" /></a>
<a href="https://pepy.tech/project/tkintertools-mpl"><img alt="Total Downloads" src="https://img.shields.io/pepy/dt/tkintertools-mpl?logo=pypi&logoColor=gold&label=Total%20Downloads" title="Total Downloads" /></a>
<a href="https://github.com/Xiaokang2022/tkintertools-mpl"><img alt="Size" src="https://img.shields.io/github/languages/code-size/Xiaokang2022/tkintertools-mpl?label=Size&logo=github" title="Code Size"/></a>
<br/>
<a href="https://github.com/Xiaokang2022/tkintertools-mpl/watchers"><img alt="Watchers" src="https://img.shields.io/github/watchers/Xiaokang2022/tkintertools-mpl?label=Watchers&logo=github&style=flat" title="Watchers" /></a>
<a href="https://github.com/Xiaokang2022/tkintertools-mpl/forks"><img alt="Forks" src="https://img.shields.io/github/forks/Xiaokang2022/tkintertools-mpl?label=Forks&logo=github&style=flat" title="Forks" /></a>
<a href="https://github.com/Xiaokang2022/tkintertools-mpl/stargazers"><img alt="Stars" src="https://img.shields.io/github/stars/Xiaokang2022/tkintertools-mpl?label=Stars&color=gold&logo=github&style=flat" title="Stars" /></a>
<a href="https://github.com/Xiaokang2022/tkintertools-mpl/issues"><img alt="Issues" src="https://img.shields.io/github/issues/Xiaokang2022/tkintertools-mpl?label=Issues&logo=github" title="Issues" /></a>
<a href="https://github.com/Xiaokang2022/tkintertools-mpl/pulls"><img alt="Pull Requests" src="https://img.shields.io/github/issues-pr/Xiaokang2022/tkintertools-mpl?label=Pull%20Requests&logo=github" title="Pull Requests" /></a>
<a href="https://github.com/Xiaokang2022/tkintertools-mpl/discussions"><img alt="Discussions" src="https://img.shields.io/github/discussions/Xiaokang2022/tkintertools-mpl?label=Discussions&logo=github" title="Discussions" /></a>
</p>

<p align="center">
<a href="https://github.com/Xiaokang2022/tkintertools-mpl/pulse"><img alt="Insights" src="https://repobeats.axiom.co/api/embed/16b936d7774f2727ca057af76b700997a60c9b67.svg" /></a>
</p>

<p align="center">
    <a href="https://star-history.com/#Xiaokang2022/tkintertools-mpl&Date">
        <picture>
            <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=Xiaokang2022/tkintertools-mpl&type=Date&theme=dark" />
            <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=Xiaokang2022/tkintertools-mpl&type=Date" />
            <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=Xiaokang2022/tkintertools-mpl&type=Date" />
        </picture>
    </a>
</p>

📦 Installation
---------------

```shell
pip install tkintertools-mpl
```

### 👀 Preview

![preview-1](./preview-1.png)

```python
import math

import matplotlib.figure
import numpy

import tkintertools
from tkintertools import mpl, theme

mpl.set_mpl_default_theme(theme.get_color_mode())

x = numpy.linspace(-math.tau, math.tau, 100)
y = numpy.sin(x)

figure = matplotlib.figure.Figure()
axes = figure.add_subplot()
axes.plot(x, y)

axes.set(xlabel='x', ylabel='y', title='Plotting based on the theme in tkt')
axes.legend(["$y=sin(x)$"])
axes.grid()

root = tkintertools.Tk((960, 720), title="tkintertools-mpl")
root.center()
canvas = tkintertools.Canvas(auto_zoom=True)
canvas.place(width=960, height=720)
figure_canvas = mpl.FigureCanvas(canvas, figure)
toolbar = mpl.FigureToolbar(canvas, figure_canvas)
figure_canvas.pack(side="top", fill="both", expand=True)

root.mainloop()
```

![preview-2](./preview-2.png)

```python
import matplotlib.figure
import numpy

import tkintertools
from tkintertools import mpl, theme

mpl.set_mpl_default_theme(theme.get_color_mode())

figure = matplotlib.figure.Figure()
axes = figure.add_subplot(projection='3d')

colors = ['r', 'g', 'b', 'y']
yticks = [3, 2, 1, 0]

for c, k in zip(colors, yticks):
    xs = numpy.arange(20)
    ys = numpy.random.rand(20)
    cs = [c] * len(xs)
    cs[0] = 'c'
    axes.bar(xs, ys, zs=k, zdir='y', color=cs, alpha=0.7)

axes.set_xlabel('X')
axes.set_ylabel('Y')
axes.set_zlabel('Z')
axes.set_title("3D plotting with interoperability")

axes.set_yticks(yticks)

root = tkintertools.Tk((960, 720), title="tkintertools-mpl")
root.center()
canvas = tkintertools.Canvas(auto_update=True)
canvas.place(width=960, height=720)
figure_canvas = mpl.FigureCanvas(canvas, figure)
toolbar = mpl.FigureToolbar(canvas, figure_canvas)
figure_canvas.pack(side="top", fill="both", expand=True)

root.mainloop()
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "maliang-mpl",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "Xiaokang2022 <2951256653@qq.com>",
    "keywords": "tkinter, maliang, matplotlib, cross-platform, themed",
    "author": null,
    "author_email": "Xiaokang2022 <2951256653@qq.com>",
    "download_url": "https://files.pythonhosted.org/packages/09/53/35f78d9aeea8b1b21125ac6e22898afdcd13a0bfb98213cb70743d0e4e9a/maliang_mpl-1.2.3.tar.gz",
    "platform": null,
    "description": "<h1 align=\"center\">maliang-mpl</h1>\r\n\r\n<p align=\"center\"><a title=\"Official Website\" href=\"https://xiaokang2022.github.io/tkintertools/\">https://xiaokang2022.github.io/tkintertools/</a></p>\r\n\r\n<p align=\"center\">Extension package of <code>maliang</code> for <code>matplotlib</code></p>\r\n\r\n<p align=\"center\">\r\n<a href=\"https://github.com/Xiaokang2022/tkintertools-mpl/releases\"><img alt=\"Version\" src=\"https://img.shields.io/github/v/release/Xiaokang2022/tkintertools-mpl?include_prereleases&logo=github&label=Version\" title=\"Latest Version\" /></a>\r\n<a href=\"https://pypistats.org/packages/tkintertools-mpl\"><img alt=\"Downloads\" src=\"https://img.shields.io/pypi/dm/tkintertools-mpl?label=Downloads&logo=pypi&logoColor=skyblue\" title=\"Downloads\" /></a>\r\n<a href=\"https://pepy.tech/project/tkintertools-mpl\"><img alt=\"Total Downloads\" src=\"https://img.shields.io/pepy/dt/tkintertools-mpl?logo=pypi&logoColor=gold&label=Total%20Downloads\" title=\"Total Downloads\" /></a>\r\n<a href=\"https://github.com/Xiaokang2022/tkintertools-mpl\"><img alt=\"Size\" src=\"https://img.shields.io/github/languages/code-size/Xiaokang2022/tkintertools-mpl?label=Size&logo=github\" title=\"Code Size\"/></a>\r\n<br/>\r\n<a href=\"https://github.com/Xiaokang2022/tkintertools-mpl/watchers\"><img alt=\"Watchers\" src=\"https://img.shields.io/github/watchers/Xiaokang2022/tkintertools-mpl?label=Watchers&logo=github&style=flat\" title=\"Watchers\" /></a>\r\n<a href=\"https://github.com/Xiaokang2022/tkintertools-mpl/forks\"><img alt=\"Forks\" src=\"https://img.shields.io/github/forks/Xiaokang2022/tkintertools-mpl?label=Forks&logo=github&style=flat\" title=\"Forks\" /></a>\r\n<a href=\"https://github.com/Xiaokang2022/tkintertools-mpl/stargazers\"><img alt=\"Stars\" src=\"https://img.shields.io/github/stars/Xiaokang2022/tkintertools-mpl?label=Stars&color=gold&logo=github&style=flat\" title=\"Stars\" /></a>\r\n<a href=\"https://github.com/Xiaokang2022/tkintertools-mpl/issues\"><img alt=\"Issues\" src=\"https://img.shields.io/github/issues/Xiaokang2022/tkintertools-mpl?label=Issues&logo=github\" title=\"Issues\" /></a>\r\n<a href=\"https://github.com/Xiaokang2022/tkintertools-mpl/pulls\"><img alt=\"Pull Requests\" src=\"https://img.shields.io/github/issues-pr/Xiaokang2022/tkintertools-mpl?label=Pull%20Requests&logo=github\" title=\"Pull Requests\" /></a>\r\n<a href=\"https://github.com/Xiaokang2022/tkintertools-mpl/discussions\"><img alt=\"Discussions\" src=\"https://img.shields.io/github/discussions/Xiaokang2022/tkintertools-mpl?label=Discussions&logo=github\" title=\"Discussions\" /></a>\r\n</p>\r\n\r\n<p align=\"center\">\r\n<a href=\"https://github.com/Xiaokang2022/tkintertools-mpl/pulse\"><img alt=\"Insights\" src=\"https://repobeats.axiom.co/api/embed/16b936d7774f2727ca057af76b700997a60c9b67.svg\" /></a>\r\n</p>\r\n\r\n<p align=\"center\">\r\n    <a href=\"https://star-history.com/#Xiaokang2022/tkintertools-mpl&Date\">\r\n        <picture>\r\n            <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/svg?repos=Xiaokang2022/tkintertools-mpl&type=Date&theme=dark\" />\r\n            <source media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/svg?repos=Xiaokang2022/tkintertools-mpl&type=Date\" />\r\n            <img alt=\"Star History Chart\" src=\"https://api.star-history.com/svg?repos=Xiaokang2022/tkintertools-mpl&type=Date\" />\r\n        </picture>\r\n    </a>\r\n</p>\r\n\r\n\ud83d\udce6 Installation\r\n---------------\r\n\r\n```shell\r\npip install tkintertools-mpl\r\n```\r\n\r\n### \ud83d\udc40 Preview\r\n\r\n![preview-1](./preview-1.png)\r\n\r\n```python\r\nimport math\r\n\r\nimport matplotlib.figure\r\nimport numpy\r\n\r\nimport tkintertools\r\nfrom tkintertools import mpl, theme\r\n\r\nmpl.set_mpl_default_theme(theme.get_color_mode())\r\n\r\nx = numpy.linspace(-math.tau, math.tau, 100)\r\ny = numpy.sin(x)\r\n\r\nfigure = matplotlib.figure.Figure()\r\naxes = figure.add_subplot()\r\naxes.plot(x, y)\r\n\r\naxes.set(xlabel='x', ylabel='y', title='Plotting based on the theme in tkt')\r\naxes.legend([\"$y=sin(x)$\"])\r\naxes.grid()\r\n\r\nroot = tkintertools.Tk((960, 720), title=\"tkintertools-mpl\")\r\nroot.center()\r\ncanvas = tkintertools.Canvas(auto_zoom=True)\r\ncanvas.place(width=960, height=720)\r\nfigure_canvas = mpl.FigureCanvas(canvas, figure)\r\ntoolbar = mpl.FigureToolbar(canvas, figure_canvas)\r\nfigure_canvas.pack(side=\"top\", fill=\"both\", expand=True)\r\n\r\nroot.mainloop()\r\n```\r\n\r\n![preview-2](./preview-2.png)\r\n\r\n```python\r\nimport matplotlib.figure\r\nimport numpy\r\n\r\nimport tkintertools\r\nfrom tkintertools import mpl, theme\r\n\r\nmpl.set_mpl_default_theme(theme.get_color_mode())\r\n\r\nfigure = matplotlib.figure.Figure()\r\naxes = figure.add_subplot(projection='3d')\r\n\r\ncolors = ['r', 'g', 'b', 'y']\r\nyticks = [3, 2, 1, 0]\r\n\r\nfor c, k in zip(colors, yticks):\r\n    xs = numpy.arange(20)\r\n    ys = numpy.random.rand(20)\r\n    cs = [c] * len(xs)\r\n    cs[0] = 'c'\r\n    axes.bar(xs, ys, zs=k, zdir='y', color=cs, alpha=0.7)\r\n\r\naxes.set_xlabel('X')\r\naxes.set_ylabel('Y')\r\naxes.set_zlabel('Z')\r\naxes.set_title(\"3D plotting with interoperability\")\r\n\r\naxes.set_yticks(yticks)\r\n\r\nroot = tkintertools.Tk((960, 720), title=\"tkintertools-mpl\")\r\nroot.center()\r\ncanvas = tkintertools.Canvas(auto_update=True)\r\ncanvas.place(width=960, height=720)\r\nfigure_canvas = mpl.FigureCanvas(canvas, figure)\r\ntoolbar = mpl.FigureToolbar(canvas, figure_canvas)\r\nfigure_canvas.pack(side=\"top\", fill=\"both\", expand=True)\r\n\r\nroot.mainloop()\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Extension package for maliang to matplotlib",
    "version": "1.2.3",
    "project_urls": {
        "Bug tracker": "https://github.com/Xiaokang2022/tkintertools-mpl/issues",
        "Source code": "https://github.com/Xiaokang2022/tkintertools-mpl"
    },
    "split_keywords": [
        "tkinter",
        " maliang",
        " matplotlib",
        " cross-platform",
        " themed"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4d97840b54871cbaa16de793ba0c63e68a622c679e3bb996c3ae438b5b976fb6",
                "md5": "3e700150974f911f35d586efb082e260",
                "sha256": "434941e0fe8c043f131c1fbef47c0c0b712480582396280288179d9be9ba6f7d"
            },
            "downloads": -1,
            "filename": "maliang_mpl-1.2.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3e700150974f911f35d586efb082e260",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 7436,
            "upload_time": "2025-01-13T14:54:01",
            "upload_time_iso_8601": "2025-01-13T14:54:01.701049Z",
            "url": "https://files.pythonhosted.org/packages/4d/97/840b54871cbaa16de793ba0c63e68a622c679e3bb996c3ae438b5b976fb6/maliang_mpl-1.2.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "095335f78d9aeea8b1b21125ac6e22898afdcd13a0bfb98213cb70743d0e4e9a",
                "md5": "f61ec1f8b7036cc2dce368de35422191",
                "sha256": "cbe9ae457fcb10f7a5ef830fa4561cb3de1faeba0092f15f7b90db5cb7995f10"
            },
            "downloads": -1,
            "filename": "maliang_mpl-1.2.3.tar.gz",
            "has_sig": false,
            "md5_digest": "f61ec1f8b7036cc2dce368de35422191",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 7057,
            "upload_time": "2025-01-13T14:54:03",
            "upload_time_iso_8601": "2025-01-13T14:54:03.360228Z",
            "url": "https://files.pythonhosted.org/packages/09/53/35f78d9aeea8b1b21125ac6e22898afdcd13a0bfb98213cb70743d0e4e9a/maliang_mpl-1.2.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-13 14:54:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Xiaokang2022",
    "github_project": "tkintertools-mpl",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "maliang-mpl"
}
        
Elapsed time: 1.09488s