Color mapping with multiple channels has long been a requested feature in Matplotlib, one this Google Summer of Code project (GSOC) has attempted to address, the figures below shows the desired functionality:
Multivariate colormaps for n dimensions
Much work has been done in the last decade related to 1-dimensional colormaps (see for eaxmple Peter Kovesis paper and Nathaniel Smith and Stéfan van der Walts talk (2015)).
This post follows my previous post on 2D colormaps, and many of the design principles will be the same. However, with n ≥ 3, it quickly becomes unfeasible to create a full lookup table. With n = 3 channels and 256 values in each channel, the lookup table would be a matrix of 256^3 elements, likely much larger than the image the colormap is applied to. Instead, n independent 1D lookup tables are created, and the resulting colors are then combined.
Continue reading “Multivariate colormaps for n dimensions”Google SoC – Bivariate colormaps
I have been accepted to Google Summer of Code!
Over the summer I will be working for Numfocus on Bivariate colormaps for matplotlib a feature that has been requested for a long time.
If you are not familiar with bivariate color maps, they come in handy to visualize complex numbers, here exemplified by the Mandelbrot set:
Designing 2D colormaps
Two dimensional colormaps are seeing use in a number of domains that rely upon python ecosystem. I work with dark-field X-ray microscopy, which is one such domain, but there are numerous others, such as astronomy, polarization microscopy etc. While each domain may have dedicated tooling, darfix, astropy, xrayutilities etc, this tooling is built upon the scientific python stack, including numpy, scipy, pandas, matplotlib, plotly, etc. Since these domains share common challenges regarding multivariate colormaps, it would be ideal to handle these challenges upstream (i.e. in matplotlib, plotly, etc.) rather than in the domain-specific packages. In addition to the technical implementation, the design criteria for multivariate colormaps must be explored.
Continue reading “Designing 2D colormaps”Visualizing Dark-Field X-ray Microscopy
A DF-XRM experiment deals with experimental geometry, sample geometry, real space and reciprocal space. To aid experimental planning I present my DF-XRM visualization app, with source code on github.
There is an associated publication in the Journal of Open Source Software
Continue reading “Visualizing Dark-Field X-ray Microscopy”Marie Skłodowska-Curie project in 1 minute
Here I describe my Marie Skłodowska–Curie project in 1 minute.
Thank you to the Eurotech foundation for prodding me to make this video.
Colorstamps – 2d colormaps
Colorstamps is a python package hosted on github and pypi for 2d colorstamps in defined as geometric shapes in the CAM02-LCD colorspace. Documentation at readthedocs. The package is inspired by the uniform colormaps in matplotlib, which has has greatly improved the visualization of scalar scientific image data.
Continue reading “Colorstamps – 2d colormaps”Intedigitated electrodes
I built a model for the electric field in thin-films with interdigitated electrodes.
An interactive demo is hosted at Streamlit, while the source is hosted on Github.
The model is presented in A unified approach for the calculation of in-plane dielectric constant of films with interdigitated electrodes.
Continue reading “Intedigitated electrodes”Mailsail – A Sailing Game
Mailsail is a sailing game made during a 2-week game jam in 2022.
The game is fully playable in the browser at https://trygvrad.itch.io/mailsail