Pixel-dependent transparency with matplotlib's imshow
Alternatives To Transparent_imshow
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
4 months ago23November 12, 201912mitJupyter Notebook
A Python 3 library to make psychrometric charts and overlay information on them.
4 years ago2Python
A Tool for Ploting the Heatmap Overlay Image
Arduino Rx5808 Testing2
6 years agomitArduino
Some Arduino RX5808 Lap Timer experiments
4 years agomitPython
A library for creating plots that can easily be combined and rendered on different plotting libraries
a year agomitPython
Pixel-dependent transparency with matplotlib's imshow
Alternatives To Transparent_imshow
Select To Compare

Alternative Project Comparisons


This is a simple wrapper around matplotlib's imshow function, which allows to produce images with pixel-dependent transparency. This can be particularly useful to overlay several images.

The solution implemented was inspired by this post.


Below is a simple example that shows how to overlay two arrays of data, by using the function transp_imshow which is provided in this package.

import numpy as np
import matplotlib.pyplot as plt
from transparent_imshow import transp_imshow

# Create some data
x, y = np.meshgrid( np.linspace(-2, 2, 100), 
                   np.linspace(-2, 2, 100) )
data1 = y
data2 = np.exp( -x**2 -y**2 )

# Plot with transparency
plt.imshow( data1, cmap='Spectral' )
transp_imshow( data2, cmap='Greys' )

The code produces the following image:


For more information on the function transp_imshow, see its docstring.


In order to install this package, type:

pip install git+
Popular Overlay Projects
Popular Matplotlib Projects
Popular User Interface Components Categories

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.