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
Realtime Web Apps and Dashboards for Python and R

H2O Wave Realtime Web Apps and Dashboards for Python and R New! R Language API Build and control Wave dashboards using R! New! Easily integrate AI/ML

H2O.ai 3.4k Jan 06, 2023
Lumen provides a framework for visual analytics, which allows users to build data-driven dashboards from a simple yaml specification

Lumen project provides a framework for visual analytics, which allows users to build data-driven dashboards from a simple yaml specification

HoloViz 120 Jan 04, 2023
📊📈 Serves up Pandas dataframes via the Django REST Framework for use in client-side (i.e. d3.js) visualizations and offline analysis (e.g. Excel)

📊📈 Serves up Pandas dataframes via the Django REST Framework for use in client-side (i.e. d3.js) visualizations and offline analysis (e.g. Excel)

wq framework 1.2k Jan 01, 2023
A simple Monte Carlo simulation using Python and matplotlib library

Monte Carlo python simulation Install linux dependencies sudo apt update sudo apt install build-essential \ software-properties-commo

Samuel Terra 2 Dec 13, 2021
Python module for drawing and rendering beautiful atoms and molecules using Blender.

Batoms is a Python package for editing and rendering atoms and molecules objects using blender. A Python interface that allows for automating workflows.

Xing Wang 1 Jul 06, 2022
An adaptable Snakemake workflow which uses GATKs best practice recommendations to perform germline mutation calling starting with BAM files

Germline Mutation Calling This Snakemake workflow follows the GATK best-practice recommandations to call small germline variants. The pipeline require

12 Dec 24, 2022
In-memory Graph Database and Knowledge Graph with Natural Language Interface, compatible with Pandas

CogniPy for Pandas - In-memory Graph Database and Knowledge Graph with Natural Language Interface Whats in the box Reasoning, exploration of RDF/OWL,

Cognitum Octopus 34 Dec 13, 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
Small U-Net for vehicle detection

Small U-Net for vehicle detection Vivek Yadav, PhD Overview In this repository , we will go over using U-net for detecting vehicles in a video stream

Vivek Yadav 91 Nov 03, 2022
Design your own matplotlib stylefile interactively

Tired of playing with font sizes and other matplotlib parameters every time you start a new project or write a new plotting function? Want all you plots have the same style? Use matplotlib configurat

yobi byte 207 Dec 08, 2022
Functions for easily making publication-quality figures with matplotlib.

Data-viz utils 📈 Functions for data visualization in matplotlib 📚 API Can be installed using pip install dvu and then imported with import dvu. You

Chandan Singh 16 Sep 15, 2022
Missing data visualization module for Python.

missingno Messy datasets? Missing values? missingno provides a small toolset of flexible and easy-to-use missing data visualizations and utilities tha

Aleksey Bilogur 3.4k Dec 29, 2022
Simple Inkscape Scripting

Simple Inkscape Scripting Description In the Inkscape vector-drawing program, how would you go about drawing 100 diamonds, each with a random color an

Scott Pakin 140 Dec 27, 2022
Gallery of applications built using bqplot and widget libraries like ipywidgets, ipydatagrid etc.

bqplot Gallery This is a gallery of bqplot examples. View the gallery at https://bqplot.github.io/bqplot-gallery. Contributing new examples Clone this

8 Aug 23, 2022
Fast scatter density plots for Matplotlib

About Plotting millions of points can be slow. Real slow... 😴 So why not use density maps? ⚡ The mpl-scatter-density mini-package provides functional

Thomas Robitaille 473 Dec 12, 2022
This component provides a wrapper to display SHAP plots in Streamlit.

streamlit-shap This component provides a wrapper to display SHAP plots in Streamlit.

Snehan Kekre 30 Dec 10, 2022
A deceptively simple plotting library for Streamlit

🍅 Plost A deceptively simple plotting library for Streamlit. Because you've been writing plots wrong all this time. Getting started pip install plost

Thiago Teixeira 192 Dec 29, 2022
Generate visualizations of GitHub user and repository statistics using GitHub Actions.

GitHub Stats Visualization Generate visualizations of GitHub user and repository statistics using GitHub Actions. This project is currently a work-in-

Aditya Thakekar 1 Jan 11, 2022
Here are my graphs for hw_02

Let's Have A Look At Some Graphs! Graph 1: State Mentions in Congressperson's Tweets on 10/01/2017 The graph below uses this data set to demonstrate h

7 Sep 02, 2022
nptsne is a numpy compatible python binary package that offers a number of APIs for fast tSNE calculation.

nptsne nptsne is a numpy compatible python binary package that offers a number of APIs for fast tSNE calculation and HSNE modelling. For more detail s

Biomedical Visual Analytics Unit LUMC - TU Delft 29 Jul 05, 2022