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
Rick and Morty Data Visualization with python

Rick and Morty Data Visualization For this project I looked at data for the TV show Rick and Morty Number of Episodes at a Certain Location Here is th

7 Aug 29, 2022
Easily convert matplotlib plots from Python into interactive Leaflet web maps.

mplleaflet mplleaflet is a Python library that converts a matplotlib plot into a webpage containing a pannable, zoomable Leaflet map. It can also embe

Jacob Wasserman 502 Dec 28, 2022
Dipto Chakrabarty 7 Sep 06, 2022
Param: Make your Python code clearer and more reliable by declaring Parameters

Param Param is a library providing Parameters: Python attributes extended to have features such as type and range checking, dynamically generated valu

HoloViz 304 Jan 07, 2023
Plot-configurations for scientific publications, purely based on matplotlib

TUEplots Plot-configurations for scientific publications, purely based on matplotlib. Usage Please have a look at the examples in the example/ directo

Nicholas Krämer 487 Jan 08, 2023
This is a super simple visualization toolbox (script) for transformer attention visualization ✌

Trans_attention_vis This is a super simple visualization toolbox (script) for transformer attention visualization ✌ 1. How to prepare your attention m

Mingyu Wang 3 Jul 09, 2022
Fastest Gephi's ForceAtlas2 graph layout algorithm implemented for Python and NetworkX

ForceAtlas2 for Python A port of Gephi's Force Atlas 2 layout algorithm to Python 2 and Python 3 (with a wrapper for NetworkX and igraph). This is the

Bhargav Chippada 227 Jan 05, 2023
Because trello only have payed options to generate a RunUp chart, this solves that!

Trello Runup Chart Generator The basic concept of the project is that Corello is pay-to-use and want to use Trello To-Do/Doing/Done automation with gi

Rômulo Schiavon 1 Dec 21, 2021
A data visualization curriculum of interactive notebooks.

A data visualization curriculum of interactive notebooks, using Vega-Lite and Altair. This repository contains a series of Python-based Jupyter notebooks.

UW Interactive Data Lab 1.2k Dec 30, 2022
Python+Numpy+OpenGL: fast, scalable and beautiful scientific visualization

Python+Numpy+OpenGL: fast, scalable and beautiful scientific visualization

Glumpy 1.1k Jan 05, 2023
Some examples with MatPlotLib library in Python

MatPlotLib Example Some examples with MatPlotLib library in Python Point: Run files only in project's directory About me Full name: Matin Ardestani Ag

Matin Ardestani 4 Mar 29, 2022
CLAHE Contrast Limited Adaptive Histogram Equalization

A simple code to process images using contrast limited adaptive histogram equalization. Image processing is becoming a major part of data processig.

Happy N. Monday 4 May 18, 2022
Extract and visualize information from Gurobi log files

GRBlogtools Extract information from Gurobi log files and generate pandas DataFrames or Excel worksheets for further processing. Also includes a wrapp

Gurobi Optimization 56 Nov 17, 2022
A GUI for Pandas DataFrames

About Demo Installation Usage Features More Info About PandasGUI is a GUI for viewing, plotting and analyzing Pandas DataFrames. Demo Installation Ins

Adam Rose 2.8k Dec 24, 2022
Use Perspective to create the chart for the trader’s dashboard

Task Overview | Installation Instructions | Link to Module 3 Introduction Experience Technology at JP Morgan Chase Try out what real work is like in t

Abdulazeez Jimoh 1 Jan 22, 2022
Simple function to plot multiple barplots in the same figure.

Simple function to plot multiple barplots in the same figure. Supports padding and custom color.

Matthias Jakobs 2 Feb 21, 2022
Editor and Presenter for Manim Generated Content.

Editor and Presenter for Manim Generated Content. Take a look at the Working Example. More information can be found on the documentation. These Browse

Manim Community 149 Dec 29, 2022
ecoglib: visualization and statistics for high density microecog signals

ecoglib: visualization and statistics for high density microecog signals This library contains high-level analysis tools for "topos" and "chronos" asp

1 Nov 17, 2021
Complex heatmaps are efficient to visualize associations between different sources of data sets and reveal potential patterns.

Make Complex Heatmaps Complex heatmaps are efficient to visualize associations between different sources of data sets and reveal potential patterns. H

Zuguang Gu 973 Jan 09, 2023
Generate SVG (dark/light) images visualizing (private/public) GitHub repo statistics for profile/website.

Generate daily updated visualizations of GitHub user and repository statistics from the GitHub API using GitHub Actions for any combination of private and public repositories, whether owned or contri

Adam Ross 2 Dec 16, 2022