Transparent_imshow

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


Alternative Project Comparisons
Readme

Overview

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.

Example

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:

image

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

Installation

In order to install this package, type:

pip install git+https://github.com/RemiLehe/transparent_imshow
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.
Python
Overlay
Matplotlib