Skip to main content

Default figure sizes for matplotlib.

Project description

mpl_sizes

A lightweight tool for setting figsize and font sizes in matplotlib, with support for:

  • ICLR
  • ICML
  • NeurIPS
  • Informatics thesis

Installation

Install via pip:

pip install mpl-sizes

Install from source:

git clone git@github.com:BayesWatch/mpl_sizes.git
cd mpl_sizes 
python setup.py install

Usage

In your plotting script:

import matplotlib.pyplot as plt
from mpl_sizes import get_format

formatter = get_format("InfThesis") # options: ICLR, ICML, NeurIPS, InfThesis

fig, ax = plt.subplots(figsize=formatter.text_width_plot())

Formatters have two methods:

  • text_width_plot - for full pagewidth plots (e.g. in double column, this would be a full width plot)
  • line_width_plot - for plots the width of the lines of text

and font size will automatically be set correctly.

A full example is given in example.py.

You can also set aspect ratio to be: "narrow", "normal", "wide", or "equal".

Aspect ratios

You can also set aspect ratio to be: "narrow", "normal", "wide", or "equal".

e.g.

A single column width plot for ICML:

A double column width plot in wide aspect ratio:

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

mpl_sizes-0.0.2.tar.gz (3.5 kB view details)

Uploaded Source

File details

Details for the file mpl_sizes-0.0.2.tar.gz.

File metadata

  • Download URL: mpl_sizes-0.0.2.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10

File hashes

Hashes for mpl_sizes-0.0.2.tar.gz
Algorithm Hash digest
SHA256 8dbedc5b969f816a4463c49440d0c6df79526f4192a76d548896714c67859d19
MD5 11baf87dd177be1a4d7bc32cf80aabd4
BLAKE2b-256 e462945634982561bc2cdd3b6d9710661bd8f9d60f088e7f2c89e2858b3f7096

See more details on using hashes here.

Provenance

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