Skip to main content

Matplotlib styles for scientific usage

Project description

Quantstyles

A set of slightly customized colormaps and styles, developed for internal use by Quantum Technology research group in the University of Rostock.

It includes the set of colormaps + custom matplotlib style.

Usage

Import the package in your script
import quantstyles
Package automatically exports all the colormaps, i.e. they could be normally used by their names, e.g.
plt.show(data, cmap="quantjet")
Custom matplotlib style will be registered during first import of the package. It can be then activated as
plt.style.use("quant")

Installation

The package is published on pypi, so it is enough to run:

pip install quantstyles

Manual installation

# clone the repo
git clone https://github.com/Trel725/quantstyles.git --recursive

# build the wheel
make

# manually install the built package
pip install dist/quantstyles-*-py3-none-any.whl

Acknoledgements

This project depends on

Development

If you'd like to manually go through all the steps:

  1. Clone the repo by git clone https://github.com/Trel725/quantstyles.git --recursive Recursive is needed to sync get-cpt repo.
  2. Generate colormaps by executing Julia code in colormaps folder
cd colormaps
julia colormaps.jl

PerceptualColourMaps.jl and PyPlot.jl need to be installed. See that code for more details, or just use pre-generated colormaps in the colormaps directory.
3. Generate Python representation of the colormaps by running python generate_quantcmaps.py. This will produce actual file containing colormaps, quantcmaps.py The command requires numpy, os, glob and (probably) urllib (from get-cpt). 4. Import quantcmaps in your script. All the listed colormaps will be available as usual, e.g. plt.imshow(data, cmap="quantjet")
5. Custom style need to be copied to the matplotlib config dir. See official manuals for details.
6. Additionally you can try to build pip wheel by executing make in the project top directory.

0.01

Initial release, includes

  • Colormaps generation
  • Packaging

0.100

  • Piblished on PyPI

0.101-0.103

  • Bug fixes

0.104

  • Added custom MPL style and its installer

0.105

  • Switched to sans-serif fonts according to Nature recommendations
  • Corrected font size for the same reason

0.106-0.107

  • Bug fixes

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

quantstyles-0.107.tar.gz (144.8 kB view hashes)

Uploaded Source

Built Distribution

quantstyles-0.107-py3-none-any.whl (162.0 kB view hashes)

Uploaded Python 3

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