Git Product home page Git Product logo

ehtplot's Introduction

Introduction

ehtplot is a python module that assists scientists in the Event Horizon Telescope (EHT) Collaboration to create publication quality, elegant, and consistent plots. It provides a set of easy-to-use plotting functions for EHT and Very-Long-Baseline Interferometry (VLBI) specific figures (see the documentation of the Figure class). This includes plotting visibility and images for both synthetic and real data, adding uv-tracks to the plots, adding the expected event horizon size to the plots, etc.

Special Features

Hierarchically Panels

By introducing a logical layer to hierarchically organize subplots and manage subplot properties, ehtplot is capable to combining many simple plots in a complex figure (see the documentation of the Panel class). For example, the following code place multiple figures side-by-side:

import ehtplot as ep
fig = ep.Figure(ep.Panel(image="1.fits"),
                ep.Panel(image="2.fits"),
                ep.Panel(image="3.fits"),
                ep.Panel(image="4.fits"))
fig.show()

This feature can help generating comparative plots for the EHT Imaging Challenge.

Multiple Themes Rendering

In a typical scientific workflow, a publication quality plot often goes to multiple places, which may have very different typesetting and coloring requirements. For example, a plot first needs to be rendered clearly and accurately onscreen; then, when exported into vector graphic formats for publications, the lines need to be visible, the font sizes of labels should match the caption font size, etc; finally, important plots also go into talks, where larger fonts and wider lines are usually preferred; in addition, slides come with different theme—dark and light backgrounds—which may require changing the color theme in a plot. In order to make creating these multi-style-multi-destination figures easy, ehtplot is theme based (see the documentation in "ehtplot/theme.py"). After creating a plot, its presentation and rendering depend on the user selected targeted outputs.

fig.save("figure.eps")
fig.save("figure-seaborn.eps", style="seaborn")
fig.save("figure-talk-dark.png", format="talk", theme="dark")

It is straightforward to enable ehtplot's theme even without using ehtplot for plotting. One simply loads the theme submodule:

import ehtplot.theme

and all ehtplot theme will be registered to matplotlib.

Perceptually Uniform Colormap

We also spent a lot of time to create perceptually uniform colormaps based on the CAM02-UCS color appearance model. For more information, see ehtplot's color submodule documentation.

It is also straightforward to enable ehtplot's colormaps even without using ehtplot for plotting. One simply loads the color submodule:

import ehtplot.color

and all ehtplot colormaps will be registered to matplotlib.

Related Links

ehtplot's People

Contributors

liamedeiros avatar rndsrc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.