Skip to main content

Simple Python plot

Python 3.10 License: AGPL v3 Code Style: Black Code Coverage

Call this pip package to easily create:

  • a boxplot
  • a multi-line plot
  • a latex table

Example Boxplot

python -m simplt --box-plot

Which is the same as running:

from simplt.boxplot.boxplot import create_box_plot
import numpy as np

extensions=[
    ".png",
],
filename="example_box",
output_dir="output",

# Fixing random state for reproducibility
np.random.seed(7)

# Generate dummy data.
first = [39, 44, 50, 50, 58, 63]
second = [80, 100, 100, 120]

# Add a name for each boxplot for in the legend, and y values.
y_series = {"data_1": first, "data_2": second}

create_box_plot(
    extensions=extensions,
    filename=filename,
    legendPosition=0,
    output_dir=output_dir,
    x_axis_label="x-axis label [units]",
    y_axis_label="y-axis label [units]",
    y_series=y_series,
)

And creates:

Example Multi-Line Plot

python -m simplt --line-plot

Which is the same as running:

from simplt.line_plot.line_plot import line_plot
import numpy as np

extensions=[
    ".png",
],
filename="example_line",
output_dir="output",

multiple_y_series = np.zeros((2, 2), dtype=int)
# actually fill with data
multiple_y_series[0] = [1, 2]
lineLabels = [
    "first-line",
    "second_line",
]  # add a label for each dataseries
single_x_series = [3, 5]

plot_multiple_lines(
    extensions=extensions,
    filename=filename,
    label=lineLabels,
    legendPosition=0,
    output_dir=output_dir,
    x=single_x_series,
    x_axis_label="x-axis label [units]",
    y_axis_label="y-axis label [units]",
    y_series=multiple_y_series,
)

And creates a (colorblind-friendly) lineplot:

Example Multi-Group Scatter Plot

python -m simplt --dot-plot

Which is the same as running:

from simplt.dotted_plot.dotted_plot import plot_multiple_dotted_groups
import numpy as np

single_x_series = [3., 5.]
multiple_y_series:Dict[int,Dict[float,List[float]]] = {}

# actually fill with data
multiple_y_series[0]={}
multiple_y_series[0][single_x_series[0]] = [1., 2., 5.]
multiple_y_series[0][single_x_series[1]] = [0., 6.]

multiple_y_series[1]={}
multiple_y_series[1][single_x_series[0]] = [3., 4.]
multiple_y_series[1][single_x_series[1]] = [1., 5.]



groupLabels = [
    "first_group",
    "second_group",
]  # add a label for each dataseries

print(multiple_y_series)
plot_multiple_dotted_groups(
    extensions=extensions,
    filename=filename,
    label=groupLabels,
    legendPosition=0,
    output_dir=output_dir,
    x_axis_label="x-axis label [units]",
    y_axis_label="y-axis label [units]",
    y_series=multiple_y_series,
)

And creates a (colorblind-friendly) dotplot:

For Developers

Below are pip-package publication instructions.

Releasing pip package update

To udate the Python pip package, one can first satisfy the following requirements:

pip install --upgrade pip setuptools wheel
pip install twine

Followed by updating the package with:

python3 setup.py sdist bdist_wheel
python -m twine upload dist/\*

Developer pip install

Build the pip package with:

pip install --upgrade pip setuptools wheel
pip install twine

Install the pip package locally with:

rm -r dist
rm -r build
python3 setup.py sdist bdist_wheel
pip install -e .

Upload the pip package to the world with:

rm -r dist
rm -r build
python3 setup.py sdist bdist_wheel
python3 -m twine upload dist/\*

Metadata

Release files for simplt 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simplt 0.0.5
File Size Uploaded Provenance
simplt-0.0.5.tar.gz 22.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for simplt 0.0.5
File Interpreter ABI Platform
simplt-0.0.5-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 45.5 kB

Release files / simplt-0.0.5.tar.gz

Download URL simplt-0.0.5.tar.gz
Size 22.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4bae71613608f474f4f0eef00c46ca9563f42e30a765d252e9a3c91a7af2a607
BLAKE2b-256 checksum
How to use checksums
4efdf6bddb29723754a6cbcfe6106acd429fd40fee541319622b749d00ad04c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release files / simplt-0.0.5-py2.py3-none-any.whl

Download URL simplt-0.0.5-py2.py3-none-any.whl
Size 22.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
c4ed038f621c0e18649f02b1ee9a5c35478e9dcb047c1f8a48aa34448542d984
BLAKE2b-256 checksum
How to use checksums
adc0b761b772e3ec9cf773a92988c3f1920907a9a8a74314b8bf884b205f53c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Security for simplt 0.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page