Skip to main content

Plotestrem

Python 3 PyPI GPLv3.0

Small Python script for rapidly fitting data in the context of experimental sciences. With Plotestrem, you can easily fit (almost) any function and get a beautiful and scalable graphic. The axes are completely LaTeX-friendly, so you can use any packages you want. It also means you can use the same font as your main document.

For now, the equation is only generated for linear and exponential fitting, which should be sufficient for many applications. Maybe in the future I'll add more support.

This code is quite old, so it's not well-written, but it works.

Example

Usage

You'll need Python 3 installed and a LaTeX distribution. Then install the package:

pip3 install plotestrem

Once you have everything set up, open runner.py, add your data and run.

Yeah, it have no interface. Maybe one day. Who knows.

Fitting types

You can fit the data using three builtin fitters, or provide your own function. You just need to pass fit_type accordingly.

  • "linear": linear fit, will plot a line and show the parameters for the y = a * x + b equation;
  • "exp": exponential fit, will plot the exponential function and show the parameters for the y = a * exp(-b * x) + c equation;
  • "none": no fitting. It just skips the regression. Your data will be plotted as a scatter plot;
  • Lastly, you can provide a function (a lambda or just the name of an existing function, without the parenthesis) to be used in the fitting. For now, the program shows only the R² value (not the parameters) for user-defined functions, but this is an interesting feature to have in the future. Also, the function to be passed should be in the form f(x, *fit), with fit being the coefficients. For example, a linear function would be passed as a f(x, a, b).

Why Plotestrem?

It's how a mineiro (native of Minas Gerais -- Brasil) would say "Plot this thing". Here you can listen a canonical speech, but it's not correct (as it's not mineiro). This one is a little better.

Author

Developed by Heliton Martins.

Metadata

Release files for plotestrem 0.0.2

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

Source distribution (sdist)

Source distribution for plotestrem 0.0.2
File Size Uploaded
plotestrem-0.0.2.tar.gz 16.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for plotestrem 0.0.2
File Interpreter ABI Platform
plotestrem-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 33.9 kB

Release files / plotestrem-0.0.2.tar.gz

Download URL plotestrem-0.0.2.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f560fe233ff1f3408f16051d45409b4162fb56be67236904fdb7c1fbaf330a20
BLAKE2b-256 checksum
How to use checksums
dc0f22747733f70b5e1a54eb7abf72a210089da0be908075391dbcdae1fa8851
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

Release files / plotestrem-0.0.2-py3-none-any.whl

Download URL plotestrem-0.0.2-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ad8472e0f7a59ab5b7af4efeb48c7ba10f40c8898a73fc2a64cae3ee10a5b1e
BLAKE2b-256 checksum
How to use checksums
dfb1c8a42bc014f550fac17ef264373a5fab71c310f4048009c069ddc6674acf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

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