Python package for drawing graphs for presentation materials with matplotlib.
Project description
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
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 | |
for_bar_graph.py |
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.
Function | Description |
---|---|
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 plt.style.use
.
from matplotlib import pyplot as plt
from reipresoplot import get_line_graph_mpl_style_path
mpl_style_path: str = get_line_graph_mpl_style_path()
plt.style.use(mpl_style_path)
plt.plot(x, y)
plt.show()
If you want to use it temporarily, use a context manager.
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 for line graph changes.
Before | After |
---|---|
Bar graph changes
Please refer to the code at examples/using_matplotlibrc_files/for_bar_graph.py for bar graph changes.
Before | After |
---|---|
Test
You can test graph drawing with Pytest.
pytest
Author
License
© 2023 NakuRei
This software is released under the MIT License, see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file rei-preso-plot-0.0.3.tar.gz
.
File metadata
- Download URL: rei-preso-plot-0.0.3.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 011858faa1598659953d06480b60bc6c1fe2c5a77aabc917099ad638366f7f31 |
|
MD5 | b61bb99ddedd1c8e78f8a2dad86e0ab1 |
|
BLAKE2b-256 | 05fcd262869e5db36498b794ec8d4b64c5d8f2d7e0dc2926e992b3659ebce8b8 |
File details
Details for the file rei_preso_plot-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: rei_preso_plot-0.0.3-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6269979f392dc29a6452287431bda9703fc6790c87e6c27f2fd100be2982a213 |
|
MD5 | b27f7abdc5d87d8d79b0bf9da5c9ca1f |
|
BLAKE2b-256 | 25a5d54af2d2a489e1547d43e6bdf39af8d7647be81efa3c9e610b022346bf8f |