Correction of usefull plotting setup for matplotlib
Project description
Pymyplot
A collection of useful presets for the visualization of scientific data. It is intended for personal usage but feel free to take a look at it. Also, the intention of this package is to use convention of tailwincss.
As I noticed, publishing this package to pypi.org appears to be overkill. Nevertheless, I have decided to do so in order to have better access to the library for my own personal use.
Requirements
- python >= 3.9
- matplotlib >= 3.6.0
Installation
You can use either poetry or pip.
pip install pymyplot
# or
poetry add pymyplot
Usage
Basic
In the module, myplt
overwrites matplotlib.pyplot
. This is intended to apply custom matplotlib.pyplot.rcparams
for a specific plot preset when it is imported. (e.g. pymyplot.aip
)
>>> from pymyplot import myplt as plt # myplt overwrites matplotlib.pyplot
>>> from pymyplot.basic import Line, Font, Marker
# Basic presets come with
# Line: default_linewidth = 1.0
# Font: default_font_size = 16.0, default_family = "sans-serif", default_font = "Helvetica"
# Marker: default_size = 16.0
>>> fig, ax = plt.subplots(...)
>>> ax.text(..., fontsize=Font.size("sm"))
>>> ax.plot(..., linewidth=Line.width("w-1.5"), marker=Marker.style("solid"))
>>> ax.scatter(..., s=Marker.size("sm"))
pymyplot
also uses tailwindcss
color convention.
>>> from pymyplot import get_color
>>> get_color("red-400")
"#f87171"
Each Font
, Line
, and Marker
class is interfacing get_color
method. Therefore, you can also use:
>>> Font.color("red-400")
"#f87171"
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 pymyplot-0.2.7.tar.gz
.
File metadata
- Download URL: pymyplot-0.2.7.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.1 CPython/3.10.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd5391237e59f7869db1b585ea084720121514076d90f6af49f0b233ec4556e6 |
|
MD5 | 2cc10c73ff2776b0729954f7beb5ae7b |
|
BLAKE2b-256 | 5f6789f01a2be1bf06b17f3298a958600aff9467c1166271bf8b1d3d72f6f4bd |
File details
Details for the file pymyplot-0.2.7-py3-none-any.whl
.
File metadata
- Download URL: pymyplot-0.2.7-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.1 CPython/3.10.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73f64065cf2c26edf3137d68c0dbeaab328eed38fa36d0ae4fe457c0a963e2c5 |
|
MD5 | 2b7f433e9e73af6613508925ec6e0cc5 |
|
BLAKE2b-256 | c8e57f6087f850da9e323aa2c9cea3d7c230185cfd86640a3e5dd7b3ea681783 |