Skip to main content

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 reipresoplot

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.

関数 説明
reipresoplot.plot_line_graph Line graph drawing function
reipresoplot.plot_bar_graph Bar graph drawing function

Plot line graph

Running examples/using_graph_functions/for_line_graph.py will produce the following graph.

plot_line_graph

Plot bar graph

Running examples/using_graph_functions/for_bar_graph.py will produce the following graph.

plot_bar_graph

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.

関数 説明
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
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
before after

Test

You can test graph drawing with Pytest.

pytest

Author

NakuRei

License

© 2023 NakuRei

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rei-preso-plot-0.0.1.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

rei_preso_plot-0.0.1-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file rei-preso-plot-0.0.1.tar.gz.

File metadata

  • Download URL: rei-preso-plot-0.0.1.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

Hashes for rei-preso-plot-0.0.1.tar.gz
Algorithm Hash digest
SHA256 4b1914c9080387a114a519ba4c59472a88d2a2d369d5b963f081124ccf6131bf
MD5 66f0b7c03097c3b11caab45657af19ad
BLAKE2b-256 f5d1b42ee5db2f0c514cc86e71a1ea8c6f48268e1a7237e8cbb177789eaccf42

See more details on using hashes here.

File details

Details for the file rei_preso_plot-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for rei_preso_plot-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d67d692463ec9340b7146a5b2617c90d098c068ff0d943a77bbfc787d34c9dcc
MD5 e20059159a0d8aca2eb69534bdc354c4
BLAKE2b-256 f858680832c0d0d40cda245b44324a31d2266a6da639e5ee90ec0f01519116f8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page