Plot-configurations for scientific publications, purely based on matplotlib

Overview

TUEplots

Plot-configurations for scientific publications, purely based on matplotlib.

Usage

Please have a look at the examples in the example/ directory.

Contribution

Tests are run with pytest. You can use tox (you only have to install tox once):

pip install tox 
tox

The CI checks for compliance of the code with black and isort, and runs the tests and the notebooks. To automatically satisfy the former, there is a pre-commit that can be used (do this once):

pip install pre-commit
pre-commit install

From then on, your code will be checked for isort and black compatibility automatically.

Comments
  • Colors

    Colors

    Feature request: I would like to propose to store the colors in colors.py not as a tuple, but as an np.array.

    Reasoning: I'm planning to add the entire Uni Tü color palette. If they're stored as np.arrays, that makes it easier to interpolate between colors, in particular to create lighter versions of existing colors.

    opened by philipphennig 7
  • Add list of supported venues to README and docs

    Add list of supported venues to README and docs

    First time users might be interested in a quick overview of whether their targeted venue is supported by tueplots. While this information can be found in the API docs, I think it would be good to provide an overview on the "landing page" of this package, i.e., either the GitHub README file or the docs index file.

    opened by braun-steven 5
  • Font seems off

    Font seems off

    Hi,

    I tried using tueplots but encountered some weird bug, where my plot got from this: im1 to this: im2 just by removing defined figsize and adding:

    from tueplots import bundles 
    
    plt.rcParams.update(bundles.neurips2021(usetex=False, ncols=2, nrows=1))
    

    Example code can be found here.

    Is this a bug or am I missing something?

    opened by dmandic17 4
  • mathit in beamer_moml is too fat

    mathit in beamer_moml is too fat

    beamer_moml uses Roboto Condensed, which matches our style for beamer. But math variables (i.e. the \mathit font) is set in regular roboto.

    MWE:

    import numpy as np
    from matplotlib import pyplot as plt
    from tueplots import bundles
    
    plt.rcParams.update({"figure.dpi": 150})
    plt.rcParams.update(bundles.beamer_moml())
    
    def f_b(x):
        return 2 ** (x / 2 - 2)
    
    
    fig, ax = plt.subplots()
    
    x = np.linspace(0, 12, num=120)
    ax.plot(x, f_b(x), "-k")
    
    ax.set_xlabel("$x$ (note that text is fine, mathit is not)")
    ax.set_ylabel("$\log f(x)=6$")
    

    I have no clue how to fix this. Anyone?

    bug enhancement 
    opened by philipphennig 2
  • Related packages

    Related packages

    It could be useful to add information about related packages somewhere (to the readme?). This way we can mix and match (and also explain what we are doing differently)

    There are for instance:

    • Seaborn: https://seaborn.pydata.org/index.html
    • ProPlot: https://proplot.readthedocs.io/en/latest/cycles.html
    • SciencePlots: https://github.com/garrettj403/SciencePlots

    Any others?

    opened by pnkraemer 2
  • Fix pre-commit error on buggy black version

    Fix pre-commit error on buggy black version

    This resolves the error below:

    ImportError: cannot import name '_unicodefun' from 'click'
    

    See https://github.com/psf/black/issues/2964

    Validation of fix:

    pre-commit clean
    pre-commit run --all-files
    
    tox -e black
    
    opened by kianmeng 1
  • Fontsize flexibility

    Fontsize flexibility

    Currently, most of the fontsizes are computed via

    def _from_base(*, base):
        return {
            "font.size": base - 1,
            "axes.labelsize": base - 1,
            "legend.fontsize": base - 3,
            "xtick.labelsize": base - 3,
            "ytick.labelsize": base - 3,
            "axes.titlesize": base - 1,
        }
    

    which has some fairly generic defaults. It would be very useful for me to be able to change the "1" and "3" values in my application. For example, via

    def _from_base(*, base, normalsize_offset=1, small_offset=3):
        return {
            "font.size": base - normalsize_offset,
            "axes.labelsize": base - normalsize_offset,
            "legend.fontsize": base - small_offset,
            "xtick.labelsize": base - small_offset,
            "ytick.labelsize": base - small_offset,
            "axes.titlesize": base - normalsize_offset,
        }
    
    opened by pnkraemer 1
  • Windows compatibility and doctests

    Windows compatibility and doctests

    It seems that tueplots is not windows compatible, likely because byexample is not.

    This can be fixed rather easily. The steps could be:

    • [x] Add windows-latest and macos-latest platforms to tests (to detect those issues)
    • [x] Replace byexample runs with doctest (it can do the same, but should be compatible with all platforms)
    bug 
    opened by pnkraemer 1
  • _Inches_per_Point is inverted

    _Inches_per_Point is inverted

    The Variable _INCHES_PER_POINT = 1.0 * 72.27 in line 5 of figsizes.py is the wrong way round. It should either be renamed to _POINTS_PER_INCH or be set to 1.0 / 72.27.

    invalid 
    opened by philipphennig 1
  • Font types

    Font types

    Often, conference and journal style files require Type-1 fonts. Per default, matplotlib uses type 3 fonts.

    One thing that one could do would be to change the rcparams to pdf.fonttype=42,

    plt.rcParams["pdf.fonttype"] = 42  # alternative would be 3
    

    which generates type 42 fonts. It is not clear entirely whether this is sufficient for the type 1 rule. That would require checking, though.

    enhancement question 
    opened by pnkraemer 1
  • Font and figure size update for beamer moml

    Font and figure size update for beamer moml

    I propose two changes, exclusively to the beamer bundle:

    • Introduced an explicit beamer_moml(), which is set to from_base(10) (Otherwise the fonts are too large)
    • Changed figsize.beamer(): I removed the rows argument, which doesn't make sense in the beamer context, and instead introduced rel_width and rel_height. In beamer slides, the typical use-case is that you know how much of the slide you want the figure to take up. This can now be achieved by setting those two parameters. Their default values are 1, which corresponds to the whole slide.
    opened by philipphennig 1
  • ICML 2023

    ICML 2023

    I would happily review a PR including a contribution of the ICML 2023 files. The call for papers (including a style file) is out now: https://icml.cc/Conferences/2023/CallForPapers.

    Most, if not all of the configurations should be the same as in the last year(s).

    enhancement good first issue 
    opened by pnkraemer 0
  • Readme images not displayed on PyPi

    Readme images not displayed on PyPi

    The images in tueplots' readme are not displayed on pypi:

    Screenshot from 2022-08-17 14-46-05

    It would be good to fix this. Maybe along the lines of what is explained here:

    https://stackoverflow.com/questions/41983209/how-do-i-add-images-to-a-pypi-readme-that-works-on-github

    documentation 
    opened by pnkraemer 0
  • Notebook quality assurance

    Notebook quality assurance

    The linters (black, isort, pylint) can be applied to the example notebooks via nbqa: https://github.com/nbQA-dev/nbQA This will enforce the same code quality for the notebooks as for the rest of the code.

    documentation 
    opened by pnkraemer 1
Releases(v0.0.5)
  • v0.0.5(Sep 16, 2022)

    What's Changed

    • light face for roboto in beamer_moml by @philipphennig in https://github.com/pnkraemer/tueplots/pull/95
    • Update the figsize notebook to be more explicit about ncols and nrows by @nathanaelbosch in https://github.com/pnkraemer/tueplots/pull/96
    • Fontsize-offset parameters by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/98
    • Fixed a few typos by @pitmonticone in https://github.com/pnkraemer/tueplots/pull/99
    • Tight(er) whitespace around figure when saving by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/101
    • AISTATS 2023 style by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/102
    • ICLR 2023 by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/105

    New Contributors

    • @nathanaelbosch made their first contribution in https://github.com/pnkraemer/tueplots/pull/96
    • @pitmonticone made their first contribution in https://github.com/pnkraemer/tueplots/pull/99

    Full Changelog: https://github.com/pnkraemer/tueplots/compare/v0.0.4...v0.0.5

    Source code(tar.gz)
    Source code(zip)
  • v0.0.4(Apr 12, 2022)

    What's Changed

    • Correct links readme by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/75
    • Manual trigger for pypi workflow by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/79
    • fixed _Inches_per_Point by @philipphennig in https://github.com/pnkraemer/tueplots/pull/82
    • Notebook linting by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/83
    • Add rel_width argument for figsizes by @marvinpfoertner in https://github.com/pnkraemer/tueplots/pull/84
    • fix typo by @tdsimao in https://github.com/pnkraemer/tueplots/pull/86
    • Troubleshooting by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/87
    • Add Neurips 2022 Style by @ltatzel in https://github.com/pnkraemer/tueplots/pull/89
    • Execute CI on MacOS, Linux, and Windows as part of the workflow by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/92
    • Set default font families in bundles to mimic paper body font. by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/93

    New Contributors

    • @marvinpfoertner made their first contribution in https://github.com/pnkraemer/tueplots/pull/84
    • @tdsimao made their first contribution in https://github.com/pnkraemer/tueplots/pull/86
    • @ltatzel made their first contribution in https://github.com/pnkraemer/tueplots/pull/89

    Full Changelog: https://github.com/pnkraemer/tueplots/compare/v0.0.3...v0.0.4

    Source code(tar.gz)
    Source code(zip)
  • v0.0.3(Jan 21, 2022)

    What's Changed

    • simplified publishing action by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/52
    • Beamer moml updates by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/54
    • Ph color by @philipphennig in https://github.com/pnkraemer/tueplots/pull/55
    • Height width ratio by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/57
    • Test improvements by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/58
    • fixed readme install by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/60
    • Aistats by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/61
    • Single column figsize width by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/62
    • Moved all requirements to setup.cfg by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/66
    • ICML updates by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/67
    • Figsize refactor by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/68
    • Sphinx by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/69
    • sphinx requirements by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/70
    • Change badge-style of licence by @not-a-feature in https://github.com/pnkraemer/tueplots/pull/73
    • Readthedocs configuration by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/72
    • Improve docs by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/74

    New Contributors

    • @not-a-feature made their first contribution in https://github.com/pnkraemer/tueplots/pull/73

    Full Changelog: https://github.com/pnkraemer/tueplots/compare/v0.0.2...v0.0.3a1

    What's Changed

    • simplified publishing action by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/52
    • Beamer moml updates by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/54
    • Ph color by @philipphennig in https://github.com/pnkraemer/tueplots/pull/55
    • Height width ratio by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/57
    • Test improvements by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/58
    • fixed readme install by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/60
    • Aistats by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/61
    • Single column figsize width by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/62
    • Moved all requirements to setup.cfg by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/66
    • ICML updates by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/67
    • Figsize refactor by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/68
    • Sphinx by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/69
    • sphinx requirements by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/70
    • Change badge-style of licence by @not-a-feature in https://github.com/pnkraemer/tueplots/pull/73
    • Readthedocs configuration by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/72
    • Improve docs by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/74

    New Contributors

    • @not-a-feature made their first contribution in https://github.com/pnkraemer/tueplots/pull/73

    Full Changelog: https://github.com/pnkraemer/tueplots/compare/v0.0.2...v0.0.3a

    What's Changed

    • simplified publishing action by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/52
    • Beamer moml updates by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/54
    • Ph color by @philipphennig in https://github.com/pnkraemer/tueplots/pull/55
    • Height width ratio by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/57
    • Test improvements by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/58
    • fixed readme install by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/60
    • Aistats by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/61
    • Single column figsize width by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/62
    • Moved all requirements to setup.cfg by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/66
    • ICML updates by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/67
    • Figsize refactor by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/68
    • Sphinx by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/69
    • sphinx requirements by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/70
    • Change badge-style of licence by @not-a-feature in https://github.com/pnkraemer/tueplots/pull/73
    • Readthedocs configuration by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/72
    • Improve docs by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/74

    New Contributors

    • @not-a-feature made their first contribution in https://github.com/pnkraemer/tueplots/pull/73

    Full Changelog: https://github.com/pnkraemer/tueplots/compare/v0.0.2...v0.0.3

    Source code(tar.gz)
    Source code(zip)
  • v0.0.1b(Jan 11, 2022)

    What's Changed

    • Improved publish by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/51

    Full Changelog: https://github.com/pnkraemer/tueplots/compare/v0.0.1...v0.0.1b

    Source code(tar.gz)
    Source code(zip)
  • v0.0.1(Jan 11, 2022)

    What's Changed

    • CI by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/1
    • tutorial for font sizes by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/2
    • added fontsizes for JMLR by @philipphennig in https://github.com/pnkraemer/tueplots/pull/3
    • Color cycles by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/5
    • CI for linting/tests (with tox) and running notebooks by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/10
    • Fonts by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/11
    • Axes by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/12
    • Colors as constants by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/13
    • Template with years by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/14
    • context managers by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/15
    • Markers by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/18
    • Readme by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/21
    • Added the University of Tübingen colors (with tests) by @philipphennig in https://github.com/pnkraemer/tueplots/pull/17
    • Constants restructured by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/22
    • Bundles by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/23
    • PIp by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/25
    • larger timeout by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/26
    • Fonts default by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/29
    • Tex bundles by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/31
    • Related packages in readme by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/32
    • Pylint by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/33
    • legends by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/34
    • Font troubleshoot and parameter update by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/35
    • Badges in readme by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/39
    • Readme by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/41
    • Jmlr updates by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/44
    • Line base ratio and axes module by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/45
    • Font and figure size update for beamer moml by @philipphennig in https://github.com/pnkraemer/tueplots/pull/46
    • Teaser images in readme by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/48
    • Module names by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/49
    • Publishing workflow by @pnkraemer in https://github.com/pnkraemer/tueplots/pull/50

    New Contributors

    • @pnkraemer made their first contribution in https://github.com/pnkraemer/tueplots/pull/1
    • @philipphennig made their first contribution in https://github.com/pnkraemer/tueplots/pull/3

    Full Changelog: https://github.com/pnkraemer/tueplots/commits/v0.0.1

    Source code(tar.gz)
    Source code(zip)
Owner
Nicholas Krämer
I am a PhD student in machine learning at the University of Tübingen and former MSc student of mathematics at the University of Bonn.
Nicholas Krämer
Official Matplotlib cheat sheets

Official Matplotlib cheat sheets

Matplotlib Developers 6.7k Jan 09, 2023
Example scripts for generating plots of Bohemian matrices

Bohemian Eigenvalue Plotting Examples This repository contains examples of generating plots of Bohemian eigenvalues. The examples in this repository a

Bohemian Matrices 5 Nov 12, 2022
Learn Data Science with focus on adding value with the most efficient tech stack.

DataScienceWithPython Get started with Data Science with Python An engaging journey to become a Data Scientist with Python TL;DR Download all Jupyter

Learn Python with Rune 110 Dec 22, 2022
RockNext is an Open Source extending ERPNext built on top of Frappe bringing enterprise ready utilization.

RockNext is an Open Source extending ERPNext built on top of Frappe bringing enterprise ready utilization.

Matheus Breguêz 13 Oct 12, 2022
Fast 1D and 2D histogram functions in Python

About Sometimes you just want to compute simple 1D or 2D histograms with regular bins. Fast. No nonsense. Numpy's histogram functions are versatile, a

Thomas Robitaille 237 Dec 18, 2022
Getting started with Python, Dash and Plot.ly for the Data Dashboards team

data_dashboards Getting started with Python, Dash and Plot.ly for the Data Dashboards team Getting started MacOS users: # Install the pyenv version ma

Department for Levelling Up, Housing and Communities 1 Nov 08, 2021
Simple and fast histogramming in Python accelerated with OpenMP.

pygram11 Simple and fast histogramming in Python accelerated with OpenMP with help from pybind11. pygram11 provides functions for very fast histogram

Doug Davis 28 Dec 14, 2022
Smoking Simulation is an app to simulate the spreading of smokers and non-smokers, their interactions and population during certain amount of time.

Smoking Simulation is an app to simulate the spreading of smokers and non-smokers, their interactions and population during certain

Bohdan Ruban 5 Nov 08, 2022
Graphing communities on Twitch.tv in a visually intuitive way

VisualizingTwitchCommunities This project maps communities of streamers on Twitch.tv based on shared viewership. The data is collected from the Twitch

Kiran Gershenfeld 312 Jan 07, 2023
A shimmer pre-load component for Plotly Dash

dash-loading-shimmer A shimmer pre-load component for Plotly Dash Installation Get it with pip: pip install dash-loading-extras Or maybe you prefer Pi

Lucas Durand 4 Oct 12, 2022
A Python function that makes flower plots.

Flower plot A Python 3.9+ function that makes flower plots. Installation This package requires at least Python 3.9. pip install

Thomas Roder 4 Jun 12, 2022
Personal IMDB Graphs with Bokeh

Personal IMDB Graphs with Bokeh Do you like watching movies and also rate all of them in IMDB? Would you like to look at your IMDB stats based on your

2 Dec 15, 2021
Cryptocurrency Centralized Exchange Visualization

This is a simple one that uses Grafina to visualize cryptocurrency from the Bitkub exchange. This service will make a request to the Bitkub API from your wallet and save the response to Postgresql. G

Popboon Mahachanawong 1 Nov 24, 2021
web application for flight log analysis & review

Flight Review This is a web application for flight log analysis. It allows users to upload ULog flight logs, and analyze them through the browser. It

PX4 Drone Autopilot 145 Dec 20, 2022
BrowZen correlates your emotional states with the web sites you visit to give you actionable insights about how you spend your time browsing the web.

BrowZen BrowZen correlates your emotional states with the web sites you visit to give you actionable insights about how you spend your time browsing t

Nick Bild 36 Sep 28, 2022
NorthPitch is a python soccer plotting library that sits on top of Matplotlib

NorthPitch is a python soccer plotting library that sits on top of Matplotlib.

Devin Pleuler 30 Feb 22, 2022
Turn a STAC catalog into a dask-based xarray

StackSTAC Turn a list of STAC items into a 4D xarray DataArray (dims: time, band, y, x), including reprojection to a common grid. The array is a lazy

Gabe Joseph 148 Dec 19, 2022
A way of looking at COVID-19 data that I haven't seen before.

Visualizing Omicron: COVID-19 Deaths vs. Cases Click here for other countries. Data is from Our World in Data/Johns Hopkins University. About this pro

1 Jan 10, 2022
An interactive dashboard built with python that enables you to visualise how rent prices differ across Sweden.

sweden-rent-dashboard An interactive dashboard built with python that enables you to visualise how rent prices differ across Sweden. The dashboard/web

Rory Crean 5 Dec 19, 2021
A napari plugin for visualising and interacting with electron cryotomograms.

napari-tomoslice A napari plugin for visualising and interacting with electron cryotomograms. Installation You can install napari-tomoslice via pip: p

3 Jan 03, 2023