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
basemap - Plot on map projections (with coastlines and political boundaries) using matplotlib.

Basemap Plot on map projections (with coastlines and political boundaries) using matplotlib. ⚠️ Warning: this package is being deprecated in favour of

Matplotlib Developers 706 Dec 28, 2022
A simple python script using Numpy and Matplotlib library to plot a Mohr's Circle when given a two-dimensional state of stress.

Mohr's Circle Calculator This is a really small personal project done for Department of Civil Engineering, Delhi Technological University (formerly, D

Agyeya Mishra 0 Jul 17, 2021
VDLdraw - Batch plot the log files exported from VisualDL using Matplotlib

VDLdraw Batch plot the log files exported from VisualDL using Matplotlib. At pre

Yizhou Chen 5 Sep 26, 2022
Scientific Visualization: Python + Matplotlib

An open access book on scientific visualization using python and matplotlib

Nicolas P. Rougier 8.6k Dec 31, 2022
python partial dependence plot toolbox

PDPbox python partial dependence plot toolbox Motivation This repository is inspired by ICEbox. The goal is to visualize the impact of certain feature

Li Jiangchun 723 Jan 7, 2023
python partial dependence plot toolbox

PDPbox python partial dependence plot toolbox Motivation This repository is inspired by ICEbox. The goal is to visualize the impact of certain feature

Li Jiangchun 531 Feb 16, 2021
This is a Cross-Platform Plot Manager for Chia Plotting that is simple, easy-to-use, and reliable.

Swar's Chia Plot Manager A plot manager for Chia plotting: https://www.chia.net/ Development Version: v0.0.1 This is a cross-platform Chia Plot Manage

Swar Patel 1.3k Dec 13, 2022
Plot, scatter plots and histograms in the terminal using braille dots

Plot, scatter plots and histograms in the terminal using braille dots, with (almost) no dependancies. Plot with color or make complex figures - similar to a very small sibling to matplotlib. Or use the canvas to plot dots and lines yourself.

Tammo Ippen 207 Dec 30, 2022
Streamlit component for Let's-Plot visualization library

streamlit-letsplot This is a work-in-progress, providing a convenience function to plot charts from the Lets-Plot visualization library. Example usage

Randy Zwitch 9 Nov 3, 2022
a python function to plot a geopandas dataframe

Pretty GeoDataFrame A minimum python function (~60 lines) to draw pretty geodataframe. Based on matplotlib, shapely, descartes. Installation just use

haoming 27 Dec 5, 2022
Small project to recursively calculate and plot each successive order of the Hilbert Curve

hilbert-curve Small project to recursively calculate and plot each successive order of the Hilbert Curve. After watching 3Blue1Brown's video on Hilber

Stefan Mejlgaard 2 Nov 15, 2021
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 8, 2021
Info for The Great DataTas plot-a-thon

The Great DataTas plot-a-thon Datatas is organising a Data Visualisation competition: The Great DataTas plot-a-thon We will be using Tidy Tuesday data

null 2 Nov 21, 2021
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
Plot and save the ground truth and predicted results of human 3.6 M and CMU mocap dataset.

Visualization-of-Human3.6M-Dataset Plot and save the ground truth and predicted results of human 3.6 M and CMU mocap dataset. human-motion-prediction

Gaurav Kumar Yadav 5 Nov 18, 2022
A tool to plot and execute Rossmos's Formula, that helps to catch serial criminals using mathematics

Rossmo Plotter A tool to plot and execute Rossmos's Formula using python, that helps to catch serial criminals using mathematics Author: Amlan Saha Ku

Amlan Saha Kundu 3 Aug 29, 2022
A custom qq-plot for two sample data comparision

QQ-Plot 2 Sample Just a gist to include the custom code to draw a qq-plot in python when dealing with a "two sample problem". This means when u try to

null 1 Dec 20, 2021
Farhad Davaripour, Ph.D. 1 Jan 5, 2022
Function Plotter: a simple application with GUI to plot mathematical functions

Function-Plotter Function Plotter is a simple application with GUI to plot mathe

Mohamed Nabawe 4 Jan 3, 2022