svg-pltmarker


Namesvg-pltmarker JSON
Version 1.0.0 PyPI version JSON
download
home_page
SummaryA library for generating Matplotlib markers from SVG files.
upload_time2024-02-19 14:27:02
maintainer
docs_urlNone
author
requires_python>=3.10
licenseMIT License Copyright (c) 2024 Yuki-Imajuku Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords svg graphic marker matplotlib path
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![PyPI - Version](https://img.shields.io/pypi/v/svg-pltmarker)
![PyPI - Status](https://img.shields.io/pypi/status/svg-pltmarker)
![PyPI - License](https://img.shields.io/pypi/l/svg-pltmarker)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/svg-pltmarker)
![PyPI - Format](https://img.shields.io/pypi/format/svg-pltmarker)
![PyPI - Downloads](https://img.shields.io/pypi/dd/svg-pltmarker)
[![pytest](https://github.com/Yuki-Imajuku/SVG-pltmarker/actions/workflows/pytest.yml/badge.svg)](https://github.com/Yuki-Imajuku/SVG-pltmarker/actions/workflows/pytest.yml)

# SVG-pltmarker
A Python library for generating matplotlib markers from SVG files.


## Install
```sh
pip install svg-pltmarker
pip install 'svg-pltmarker[dev]'  # for developers
```


## Dependencies
Python version 3.10.0 or higher is required.

Libraries:
- [matplotlib](https://github.com/matplotlib/matplotlib) >= 3.6.0
- [NumPy](https://github.com/numpy/numpy) >= 1.22.0
- [pydantic](https://github.com/pydantic/pydantic) >= 2.0.0


# Usage
[Sample notebook (Colaboratory)](https://colab.research.google.com/drive/1YGBuv989P6mco8-EPWTqPBMccojDAcVa?usp=sharing)

```python
import matplotlib.pyplot as plt
import numpy as np
from svg_pltmarker import get_marker_from_svg


# Generate Maplotlib marker from SVG file.
marker = get_marker_from_svg(url="https://upload.wikimedia.org/wikipedia/commons/8/84/Matplotlib_icon.svg")

# Scatter plot
fig, ax = plt.subplots(figsize=(10, 10))
ax.set_aspect("equal")
ax.set_axis_off()
x, y = np.meshgrid(np.linspace(0, 2, 11), np.linspace(0, 2, 11))
plt.scatter(x, y, marker=marker, s=2500, color="None", edgecolors="black")
plt.xlim(0, 2)
plt.ylim(0, 2)
plt.show()
```

Then get below figure:

![Sample Figure](https://github.com/Yuki-Imajuku/SVG-pltmarker/blob/main/figures/sample_figure.png)


## Reference
1. [https://developer.mozilla.org/ja/docs/Web/SVG/Element](https://developer.mozilla.org/ja/docs/Web/SVG/Element)
2. [https://triple-underscore.github.io/SVG11/shapes.html](https://triple-underscore.github.io/SVG11/shapes.html)
3. [https://github.com/nvictus/svgpath2mpl](https://github.com/nvictus/svgpath2mpl)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "svg-pltmarker",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "SVG,graphic,marker,matplotlib,path",
    "author": "",
    "author_email": "Yuki Imajuku <yuki.imjk@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/df/22/9252439c885522a955732b781936e5ec0d1ad9957345f325d0b358679a5d/svg_pltmarker-1.0.0.tar.gz",
    "platform": null,
    "description": "![PyPI - Version](https://img.shields.io/pypi/v/svg-pltmarker)\n![PyPI - Status](https://img.shields.io/pypi/status/svg-pltmarker)\n![PyPI - License](https://img.shields.io/pypi/l/svg-pltmarker)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/svg-pltmarker)\n![PyPI - Format](https://img.shields.io/pypi/format/svg-pltmarker)\n![PyPI - Downloads](https://img.shields.io/pypi/dd/svg-pltmarker)\n[![pytest](https://github.com/Yuki-Imajuku/SVG-pltmarker/actions/workflows/pytest.yml/badge.svg)](https://github.com/Yuki-Imajuku/SVG-pltmarker/actions/workflows/pytest.yml)\n\n# SVG-pltmarker\nA Python library for generating matplotlib markers from SVG files.\n\n\n## Install\n```sh\npip install svg-pltmarker\npip install 'svg-pltmarker[dev]'  # for developers\n```\n\n\n## Dependencies\nPython version 3.10.0 or higher is required.\n\nLibraries:\n- [matplotlib](https://github.com/matplotlib/matplotlib) >= 3.6.0\n- [NumPy](https://github.com/numpy/numpy) >= 1.22.0\n- [pydantic](https://github.com/pydantic/pydantic) >= 2.0.0\n\n\n# Usage\n[Sample notebook (Colaboratory)](https://colab.research.google.com/drive/1YGBuv989P6mco8-EPWTqPBMccojDAcVa?usp=sharing)\n\n```python\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom svg_pltmarker import get_marker_from_svg\n\n\n# Generate Maplotlib marker from SVG file.\nmarker = get_marker_from_svg(url=\"https://upload.wikimedia.org/wikipedia/commons/8/84/Matplotlib_icon.svg\")\n\n# Scatter plot\nfig, ax = plt.subplots(figsize=(10, 10))\nax.set_aspect(\"equal\")\nax.set_axis_off()\nx, y = np.meshgrid(np.linspace(0, 2, 11), np.linspace(0, 2, 11))\nplt.scatter(x, y, marker=marker, s=2500, color=\"None\", edgecolors=\"black\")\nplt.xlim(0, 2)\nplt.ylim(0, 2)\nplt.show()\n```\n\nThen get below figure:\n\n![Sample Figure](https://github.com/Yuki-Imajuku/SVG-pltmarker/blob/main/figures/sample_figure.png)\n\n\n## Reference\n1. [https://developer.mozilla.org/ja/docs/Web/SVG/Element](https://developer.mozilla.org/ja/docs/Web/SVG/Element)\n2. [https://triple-underscore.github.io/SVG11/shapes.html](https://triple-underscore.github.io/SVG11/shapes.html)\n3. [https://github.com/nvictus/svgpath2mpl](https://github.com/nvictus/svgpath2mpl)\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Yuki-Imajuku  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "A library for generating Matplotlib markers from SVG files.",
    "version": "1.0.0",
    "project_urls": {
        "repository": "https://github.com/Yuki-Imajuku/SVG-pltmarker"
    },
    "split_keywords": [
        "svg",
        "graphic",
        "marker",
        "matplotlib",
        "path"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7e40716b6969e7f92d1f645673c230249de040d5e4498ebaed0d99a82802a206",
                "md5": "407f20d960ca505a8630ae9daa966282",
                "sha256": "89aad9988637812960d2a60477b27bfea3ed53754ce90138b66163202cfe215a"
            },
            "downloads": -1,
            "filename": "svg_pltmarker-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "407f20d960ca505a8630ae9daa966282",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 15370,
            "upload_time": "2024-02-19T14:27:01",
            "upload_time_iso_8601": "2024-02-19T14:27:01.418627Z",
            "url": "https://files.pythonhosted.org/packages/7e/40/716b6969e7f92d1f645673c230249de040d5e4498ebaed0d99a82802a206/svg_pltmarker-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "df229252439c885522a955732b781936e5ec0d1ad9957345f325d0b358679a5d",
                "md5": "7c711c77c2d4098f8f0f60dbd8c802a9",
                "sha256": "11b83d049d396bae9d908bb9e967f62a7dc7ee4eb62197fc29e1ee920b4d69f2"
            },
            "downloads": -1,
            "filename": "svg_pltmarker-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "7c711c77c2d4098f8f0f60dbd8c802a9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 11269,
            "upload_time": "2024-02-19T14:27:02",
            "upload_time_iso_8601": "2024-02-19T14:27:02.609068Z",
            "url": "https://files.pythonhosted.org/packages/df/22/9252439c885522a955732b781936e5ec0d1ad9957345f325d0b358679a5d/svg_pltmarker-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-19 14:27:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Yuki-Imajuku",
    "github_project": "SVG-pltmarker",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "svg-pltmarker"
}
        
Elapsed time: 0.18478s