rei-preso-plot


Namerei-preso-plot JSON
Version 0.1.0 PyPI version JSON
download
home_page
SummaryPython package for drawing graphs for presentation materials with matplotlib.
upload_time2023-02-11 19:50:52
maintainer
docs_urlNone
author
requires_python>=3.7
licenseMIT License Copyright (c) 2023 NakuRei 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 graph plot presentation preso
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # rei-preso-plot

[![Publish Python distributions to PyPI](https://github.com/NakuRei/rei-preso-plot/actions/workflows/publish-to-test-pypi.yml/badge.svg)](https://github.com/NakuRei/rei-preso-plot/actions/workflows/publish-to-test-pypi.yml)
![License](https://img.shields.io/github/license/NakuRei/rei-preso-plot)

Python package for drawing graphs for presentation materials with `matplotlib`.

## Description

A package for creating graphs suitable for presentation materials with `matplotlib`.
The created graph can be directly placed on a presentation slide with a nice design.

## Requirement

- Python 3.11.1
- matplotlib 3.6.3

## Installation

```shell
pip install rei-preso-plot
```

## Usage

### Using graph functions

Graph functions.
Can emphasize parts by adding color or embedding legends in line graphs.
When passing `matplotlib.axes.Axes` to the argument ax, it returns the `matplotlib.axes.Axes`. Therefore, using the functions of `matplotlib`, you can specify the drawing range, etc., after these functions.

| Function                       | Description                 |
| :----------------------------- | :-------------------------- |
| `reipresoplot.plot_line_graph` | Line graph drawing function |
| `reipresoplot.plot_bar_graph`  | Bar graph drawing function  |

| Code                                      | Graph                          |
| :---------------------------------------- | :----------------------------- |
| [for_line_graph.py][line_graph_code_link] | ![Line graph][line_graph_link] |
| [for_bar_graph.py][bar_graph_code_link]   | ![Bar graph][bar_graph_link]   |

[line_graph_link]: https://github.com/NakuRei/rei-preso-plot/raw/main/examples/using_graph_functions/result/plot_line_graph.png
[line_graph_code_link]: https://github.com/NakuRei/rei-preso-plot/blob/main/examples/using_graph_functions/for_line_graph.py
[bar_graph_code_link]: https://github.com/NakuRei/rei-preso-plot/blob/main/examples/using_graph_functions/for_bar_graph.py
[bar_graph_link]: https://github.com/NakuRei/rei-preso-plot/raw/main/examples/using_graph_functions/result/plot_bar_graph.png

### Using matplotlibrc files

By reading `matplotlibrc` files, you can customize the `matplotlib` style as a whole, i.e. without specifying it with `rcParams`, etc.
For details, see [Matplotlib documentation](https://matplotlib.org/stable/tutorials/introductory/customizing.html).

| Function                                               | Description                                                |
| :----------------------------------------------------- | :--------------------------------------------------------- |
| `reipresoplot.use_line_graph_style_as_global_settings` | Use `matplotlibrc` file for line graphs as global settings |
| `reipresoplot.use_bar_graph_style_as_global_settings`  | Use `matplotlibrc` file for bar graphs as global settings  |
| `reipresoplot.get_line_graph_mpl_style_path`           | Get the path to the `matplotlibrc` file for line graphs    |
| `reipresoplot.get_bar_graph_mpl_style_path`            | Get the path to the `matplotlibrc` file for bar graphs     |

If you want to apply the style globally to the entire graph plot, use `reipresoplot.use_XXX_graph_style_as_global_settings`.

```python
from matplotlib import pyplot as plt
from reipresoplot import use_line_graph_style_as_global_settings

use_line_graph_style_as_global_settings()

plt.plot(x, y)
plt.show()
```

If you want to use it temporarily, use a context manager.

```python
from reipresoplot import get_line_graph_mpl_style_path

mpl_style_path: str = get_line_graph_mpl_style_path()
with plt.style.context(mpl_style_path):
    plt.plot(x, y)
    plt.show()
```

#### Line graph changes

Please refer to the code at [examples/using_matplotlibrc_files/for_line_graph.py](https://github.com/NakuRei/rei-preso-plot/blob/main/examples/using_matplotlibrc_files/for_line_graph.py) for line graph changes.

|           Before            |           After           |
| :-------------------------: | :-----------------------: |
| ![Before][before_line_link] | ![After][after_line_link] |

[before_line_link]: https://raw.githubusercontent.com/NakuRei/rei-preso-plot/main/examples/using_matplotlibrc_files/result/line_graph_before.png
[after_line_link]: https://raw.githubusercontent.com/NakuRei/rei-preso-plot/main/examples/using_matplotlibrc_files/result/line_graph_after.png

#### Bar graph changes

Please refer to the code at [examples/using_matplotlibrc_files/for_bar_graph.py](https://github.com/NakuRei/rei-preso-plot/blob/main/examples/using_matplotlibrc_files/for_bar_graph.py) for bar graph changes.

|           Before           |          After           |
| :------------------------: | :----------------------: |
| ![Before][before_bar_link] | ![After][after_bar_link] |

[before_bar_link]: https://raw.githubusercontent.com/NakuRei/rei-preso-plot/main/examples/using_matplotlibrc_files/result/bar_graph_before.png
[after_bar_link]: https://raw.githubusercontent.com/NakuRei/rei-preso-plot/main/examples/using_matplotlibrc_files/result/bar_graph_after.png

## Test

You can test graph drawing with Pytest.

```shell
pytest
```

## Author

[NakuRei](https://notes.nakurei.com/about/)

## License

© 2023 NakuRei

This software is released under the MIT License, see LICENSE.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "rei-preso-plot",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "graph,plot,presentation,preso",
    "author": "",
    "author_email": "NakuRei <nakurei7901@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/47/c9/eb80374c1120124adc4ae924a7053c3289ecb9b48f2d99bfe330e747714a/rei-preso-plot-0.1.0.tar.gz",
    "platform": null,
    "description": "# rei-preso-plot\n\n[![Publish Python distributions to PyPI](https://github.com/NakuRei/rei-preso-plot/actions/workflows/publish-to-test-pypi.yml/badge.svg)](https://github.com/NakuRei/rei-preso-plot/actions/workflows/publish-to-test-pypi.yml)\n![License](https://img.shields.io/github/license/NakuRei/rei-preso-plot)\n\nPython package for drawing graphs for presentation materials with `matplotlib`.\n\n## Description\n\nA package for creating graphs suitable for presentation materials with `matplotlib`.\nThe created graph can be directly placed on a presentation slide with a nice design.\n\n## Requirement\n\n- Python 3.11.1\n- matplotlib 3.6.3\n\n## Installation\n\n```shell\npip install rei-preso-plot\n```\n\n## Usage\n\n### Using graph functions\n\nGraph functions.\nCan emphasize parts by adding color or embedding legends in line graphs.\nWhen passing `matplotlib.axes.Axes` to the argument ax, it returns the `matplotlib.axes.Axes`. Therefore, using the functions of `matplotlib`, you can specify the drawing range, etc., after these functions.\n\n| Function                       | Description                 |\n| :----------------------------- | :-------------------------- |\n| `reipresoplot.plot_line_graph` | Line graph drawing function |\n| `reipresoplot.plot_bar_graph`  | Bar graph drawing function  |\n\n| Code                                      | Graph                          |\n| :---------------------------------------- | :----------------------------- |\n| [for_line_graph.py][line_graph_code_link] | ![Line graph][line_graph_link] |\n| [for_bar_graph.py][bar_graph_code_link]   | ![Bar graph][bar_graph_link]   |\n\n[line_graph_link]: https://github.com/NakuRei/rei-preso-plot/raw/main/examples/using_graph_functions/result/plot_line_graph.png\n[line_graph_code_link]: https://github.com/NakuRei/rei-preso-plot/blob/main/examples/using_graph_functions/for_line_graph.py\n[bar_graph_code_link]: https://github.com/NakuRei/rei-preso-plot/blob/main/examples/using_graph_functions/for_bar_graph.py\n[bar_graph_link]: https://github.com/NakuRei/rei-preso-plot/raw/main/examples/using_graph_functions/result/plot_bar_graph.png\n\n### Using matplotlibrc files\n\nBy reading `matplotlibrc` files, you can customize the `matplotlib` style as a whole, i.e. without specifying it with `rcParams`, etc.\nFor details, see [Matplotlib documentation](https://matplotlib.org/stable/tutorials/introductory/customizing.html).\n\n| Function                                               | Description                                                |\n| :----------------------------------------------------- | :--------------------------------------------------------- |\n| `reipresoplot.use_line_graph_style_as_global_settings` | Use `matplotlibrc` file for line graphs as global settings |\n| `reipresoplot.use_bar_graph_style_as_global_settings`  | Use `matplotlibrc` file for bar graphs as global settings  |\n| `reipresoplot.get_line_graph_mpl_style_path`           | Get the path to the `matplotlibrc` file for line graphs    |\n| `reipresoplot.get_bar_graph_mpl_style_path`            | Get the path to the `matplotlibrc` file for bar graphs     |\n\nIf you want to apply the style globally to the entire graph plot, use `reipresoplot.use_XXX_graph_style_as_global_settings`.\n\n```python\nfrom matplotlib import pyplot as plt\nfrom reipresoplot import use_line_graph_style_as_global_settings\n\nuse_line_graph_style_as_global_settings()\n\nplt.plot(x, y)\nplt.show()\n```\n\nIf you want to use it temporarily, use a context manager.\n\n```python\nfrom reipresoplot import get_line_graph_mpl_style_path\n\nmpl_style_path: str = get_line_graph_mpl_style_path()\nwith plt.style.context(mpl_style_path):\n    plt.plot(x, y)\n    plt.show()\n```\n\n#### Line graph changes\n\nPlease refer to the code at [examples/using_matplotlibrc_files/for_line_graph.py](https://github.com/NakuRei/rei-preso-plot/blob/main/examples/using_matplotlibrc_files/for_line_graph.py) for line graph changes.\n\n|           Before            |           After           |\n| :-------------------------: | :-----------------------: |\n| ![Before][before_line_link] | ![After][after_line_link] |\n\n[before_line_link]: https://raw.githubusercontent.com/NakuRei/rei-preso-plot/main/examples/using_matplotlibrc_files/result/line_graph_before.png\n[after_line_link]: https://raw.githubusercontent.com/NakuRei/rei-preso-plot/main/examples/using_matplotlibrc_files/result/line_graph_after.png\n\n#### Bar graph changes\n\nPlease refer to the code at [examples/using_matplotlibrc_files/for_bar_graph.py](https://github.com/NakuRei/rei-preso-plot/blob/main/examples/using_matplotlibrc_files/for_bar_graph.py) for bar graph changes.\n\n|           Before           |          After           |\n| :------------------------: | :----------------------: |\n| ![Before][before_bar_link] | ![After][after_bar_link] |\n\n[before_bar_link]: https://raw.githubusercontent.com/NakuRei/rei-preso-plot/main/examples/using_matplotlibrc_files/result/bar_graph_before.png\n[after_bar_link]: https://raw.githubusercontent.com/NakuRei/rei-preso-plot/main/examples/using_matplotlibrc_files/result/bar_graph_after.png\n\n## Test\n\nYou can test graph drawing with Pytest.\n\n```shell\npytest\n```\n\n## Author\n\n[NakuRei](https://notes.nakurei.com/about/)\n\n## License\n\n\u00a9 2023 NakuRei\n\nThis software is released under the MIT License, see LICENSE.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023 NakuRei  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": "Python package for drawing graphs for presentation materials with matplotlib.",
    "version": "0.1.0",
    "split_keywords": [
        "graph",
        "plot",
        "presentation",
        "preso"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "809e05b2e2f497761fdf49c6407fb5f791b7d5f1d7e5282d96a3e6be537beef4",
                "md5": "869f474366fdb066b9adec7f0c102704",
                "sha256": "b74a73725143b219c3661e9c24a387f064c68ef7d1d891f39bc3a45144ff79cb"
            },
            "downloads": -1,
            "filename": "rei_preso_plot-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "869f474366fdb066b9adec7f0c102704",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 12060,
            "upload_time": "2023-02-11T19:50:51",
            "upload_time_iso_8601": "2023-02-11T19:50:51.442864Z",
            "url": "https://files.pythonhosted.org/packages/80/9e/05b2e2f497761fdf49c6407fb5f791b7d5f1d7e5282d96a3e6be537beef4/rei_preso_plot-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "47c9eb80374c1120124adc4ae924a7053c3289ecb9b48f2d99bfe330e747714a",
                "md5": "f29b59379c4240bfff8f0c22aa8e6640",
                "sha256": "e475c40da5f4f66b024854577a616613ab2771362b00795e4139ed9a3f5bcbbd"
            },
            "downloads": -1,
            "filename": "rei-preso-plot-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f29b59379c4240bfff8f0c22aa8e6640",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 8272,
            "upload_time": "2023-02-11T19:50:52",
            "upload_time_iso_8601": "2023-02-11T19:50:52.508644Z",
            "url": "https://files.pythonhosted.org/packages/47/c9/eb80374c1120124adc4ae924a7053c3289ecb9b48f2d99bfe330e747714a/rei-preso-plot-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-02-11 19:50:52",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "rei-preso-plot"
}
        
Elapsed time: 0.04260s