0

I have created the following three example heat maps:

import numpy as np
import matplotlib.pyplot as plt

fig = plt.figure(figsize=(15, 10))

img1 = np.array([[1.23,2.12,3.11],[0.99,1.44,1.04],[1.1,2.1,1.5]])
ax1 = fig.add_subplot(1, 3, 1)
im = ax1.imshow(img1, origin='lower', cmap='Blues')

img2 = np.array([[1.12,2.0,3.02],[0.3,1.23,0.2],[1.0,1.1,0.3]])
ax1 = fig.add_subplot(1, 3, 2)
im2 = ax1.imshow(img2, origin='lower', cmap='Blues')

img3 = np.array([[0.9,1.44,1.9],[0.1,1.1,0.19],[0.9,1.0,0.2]])
ax1 = fig.add_subplot(1, 3, 3)
im3 = ax1.imshow(img3, origin='lower', cmap='Blues')

plt.tight_layout()
plt.show()

enter image description here

Now I would like to merge these three heat maps (images) into one heat map (one image) using barycentric coordinates and normalizing (range 0 to 1) per heat map (dimension).

As far as I know barycentric coordinates could look as follows:

enter image description here

How can I create this color triangle (colormap) in python and how can I then use this to create a heat map?

machinery
  • 5,972
  • 12
  • 67
  • 118
  • [Does this help?](https://stackoverflow.com/questions/29512046/how-to-create-ternary-contour-plot-in-python) – DataNoob May 26 '21 at 18:56
  • @DataNoob Thanks for the link but it only shows how to create a color triangle but not how to sample a color from the triangle. – machinery May 27 '21 at 17:37

0 Answers0