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
Some useful extensions for Matplotlib.

mplx Some useful extensions for Matplotlib. Contour plots for functions with discontinuities plt.contour mplx.contour(max_jump=1.0) Matplotlib has pro

Nico Schlömer 519 Dec 30, 2022
100 data puzzles for pandas, ranging from short and simple to super tricky (60% complete)

100 pandas puzzles Puzzles notebook Solutions notebook Inspired by 100 Numpy exerises, here are 100* short puzzles for testing your knowledge of panda

Alex Riley 1.9k Jan 08, 2023
A declarative (epi)genomics visualization library for Python

gos is a declarative (epi)genomics visualization library for Python. It is built on top of the Gosling JSON specification, providing a simplified interface for authoring interactive genomic visualiza

Gosling 107 Dec 14, 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
Pretty Confusion Matrix

Pretty Confusion Matrix Why pretty confusion matrix? We can make confusion matrix by using matplotlib. However it is not so pretty. I want to make con

Junseo Ko 5 Nov 22, 2022
FairLens is an open source Python library for automatically discovering bias and measuring fairness in data

FairLens FairLens is an open source Python library for automatically discovering bias and measuring fairness in data. The package can be used to quick

Synthesized 69 Dec 15, 2022
Smarthome Dashboard with Grafana & InfluxDB

Smarthome Dashboard with Grafana & InfluxDB This is a complete overhaul of my Raspberry Dashboard done with Flask. I switched from sqlite to InfluxDB

6 Oct 20, 2022
An interactive dashboard for visualisation, integration and classification of data using Active Learning.

AstronomicAL An interactive dashboard for visualisation, integration and classification of data using Active Learning. AstronomicAL is a human-in-the-

45 Nov 28, 2022
Create charts with Python in a very similar way to creating charts using Chart.js

Create charts with Python in a very similar way to creating charts using Chart.js. The charts created are fully configurable, interactive and modular and are displayed directly in the output of the t

Nicolas H 68 Dec 08, 2022
Practical-statistics-for-data-scientists - Code repository for O'Reilly book

Code repository Practical Statistics for Data Scientists: 50+ Essential Concepts Using R and Python by Peter Bruce, Andrew Bruce, and Peter Gedeck Pub

1.7k Jan 04, 2023
Movie recommendation using RASA, TigerGraph

Demo run: The below video will highlight the runtime of this setup and some sample real-time conversations using the power of RASA + TigerGraph, Steps

Sudha Vijayakumar 3 Sep 10, 2022
It's an application to calculate I from v and r. It can also plot a graph between V vs I.

Ohm-s-Law-Visualizer It's an application to calculate I from v and r using Ohm's Law. It can also plot a graph between V vs I. Story I'm doing my Unde

Sihab Sahariar 1 Nov 20, 2021
Show Data: Show your dataset in web browser!

Show Data is to generate html tables for large scale image dataset, especially for the dataset in remote server. It provides some useful commond line tools and fully customizeble API reference to gen

Dechao Meng 83 Nov 26, 2022
Python support for Godot 🐍🐍🐍

Godot Python, because you want Python on Godot ! The goal of this project is to provide Python language support as a scripting module for the Godot ga

Emmanuel Leblond 1.4k Jan 04, 2023
Parallel t-SNE implementation with Python and Torch wrappers.

Multicore t-SNE This is a multicore modification of Barnes-Hut t-SNE by L. Van der Maaten with python and Torch CFFI-based wrappers. This code also wo

Dmitry Ulyanov 1.7k Jan 09, 2023
2021 grafana arbitrary file read

2021_grafana_arbitrary_file_read base on pocsuite3 try 40 default plugins of grafana alertlist annolist barchart cloudwatch dashlist elasticsearch gra

ATpiu 5 Nov 09, 2022
An animation engine for explanatory math videos

Powered By: An animation engine for explanatory math videos Hi there, I'm Zheer 👋 I'm a Software Engineer and student!! 🌱 I’m currently learning eve

Zaheer ud Din Faiz 2 Nov 04, 2021
An automatic prover for tautologies in Metamath

completeness An automatic prover for tautologies in Metamath This program implements the constructive proof of the Completeness Theorem for propositio

Scott Fenton 2 Dec 15, 2021
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 small tool to test and visualize protein embeddings and amino acid proportions.

polyprotein_stats A small tool to test and visualize protein embeddings and amino acid proportions. Currently deployed on streamlit.io. Given a set of

2 Jan 07, 2023