bfmplot
A collection of snippets for plots to make my life easier. The name is a nod to the great Burkhard Bunk.
Install
Clone this repository
git clone git@github.com:benmaier/bfmplot.git
Install as development version (such that you don’t have to reinstall after updating the repository)
pip install -e ./bfmplot --no-binary :all:
cd bfmplot; make
Alternatively, install normally
pip install ./bfmplot
cd bfmplot; make install
Examples
First Example
from bfmplot import pl
import bfmplot as bp
import numpy as np
def sin_test(n=8,text_position='start'):
# new figure in the golden ratio
pl.figure(figsize=bp.golden_ratio(5))
x = np.linspace(0,5*np.pi,100)
# plot several functions with different markers
for i in range(n):
pl.plot(x, 1-np.sin(x[::-1]/np.sqrt(i+1)), marker=bp.markers[i],mfc='w',label='$i=%d$'%i)
# remove right and top axis
bp.strip_axis(pl.gca())
# order legend items to align to the right
leg = pl.legend()
bp.align_legend_right(leg)
# draw an arrow
bp.arrow(pl.gca(), r'$i$', (6, 0.8), (3, 1.8), text_position=text_position)
pl.xlabel('this is the x-label')
pl.ylabel('this is the y-label')
pl.gcf().tight_layout()
sin_test(n=4,text_position='start')
pl.show()
Colors
for colors,name in zip([
bp.mpl_default_colors,
bp.new_colors,
bp.brewer_qualitative,
bp.cccs_colors,
bp.get_cividis_colors(8),
bp.wong,
],
[
'bfmplot.mpl_default_colors',
'bfmplot.new_colors',
'bfmplot.brewer_qualitative',
'bfmplot.cccs_colors',
'bfmplot.get_cividis_colors(8)',
'bfmplot.wong',
],
):
bp.set_color_cycle(colors)
sin_test(n=8,text_position='start')
Metadata
Release files for bfmplot 0.0.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bfmplot-0.0.11.tar.gz | 14.8 kB | Without provenance | Details for bfmplot-0.0.11.tar.gz |
Release files / bfmplot-0.0.11.tar.gz
| Download URL | bfmplot-0.0.11.tar.gz |
|---|---|
| Size | 14.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
52e4fd33adbf564cbc93f730cfef315344e775a3ed07e308d37664d025184efe
|
|
BLAKE2b-256 checksum How to use checksums |
f73de1041734a38bd54d520bb17f876a5657d2a9acc6f426c3e42d06ccf66a91
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/54.2.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.9
|
Security for bfmplot 0.0.11
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.