Skip to main content

Plotting functions for EHT

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyehtplot-0.9.0.tar.gz (468.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyehtplot-0.9.0-py3-none-any.whl (591.7 kB view details)

Uploaded Python 3

File details

Details for the file pyehtplot-0.9.0.tar.gz.

File metadata

  • Download URL: pyehtplot-0.9.0.tar.gz
  • Upload date:
  • Size: 468.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.5

File hashes

Hashes for pyehtplot-0.9.0.tar.gz
Algorithm Hash digest
SHA256 0cfe56d7bee584e0ad7e7538740b2566fb1affb18c4af3596faf22e55236da0c
MD5 9b6260d522d979b56ec52477b45ef1c3
BLAKE2b-256 97948807451f54f2cc6b5ec7968c71d64898b6fabb957ccb0554b80661cb726e

See more details on using hashes here.

File details

Details for the file pyehtplot-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: pyehtplot-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 591.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.5

File hashes

Hashes for pyehtplot-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b6b8af1b486723013f49a65577410bb0e1c1eee1a0bdd9e96b7b640afd3717fa
MD5 5587801456ad619213d43ecda66a3731
BLAKE2b-256 98e6bccc881c3fbfc1572573e06ac60c4503e54b26565691b293062cc162d23a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page