You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for your work. I am facing some problem with plotting heatmaps.
I have list as shown below: [ [0.2, 0.4,0.4, 0.90], [0.5, 0.1,0.4, 0.59], [0.3, 0.6,0.1, 0.87] ......, [0.4, 0.3,0.3, 0.95] ]
where the first three indexes are some parameters of my machine learning model and 4th is the accuracy value.
I want to plot triangular heat map, where each point inside the triangle is represented by the first three indexes of my list and each of those points have a heat value of: 4th index in my list.
This is what I tried :
def color_point_new(x, y, z, m):
w = 255
print(x,y,z)
m_color = float(m) * w/255
r = math.fabs(w - m_color) / w
g=0
b=0
print(m_color)
return (m_color, g, b, 1.)
def generate_heatmap_data_new(scale=5):
d = dict()
X = [0.2,0.3,0.4,0.5]
Y = [0.5,0.6,0.5,0.1]
Z = [0.3,0.1,0.1,0.4]
M = [0.67,0.87,0.78,0.90]
for i in range(len(X)):
total = X[i] + Y[i] + Z[i]
x_norm = X[i] / total
y_norm = Y[i] / total
z_norm = Z[i] / total
d[(X[i], Y[i], Z[i])] = color_point_new(x_norm, y_norm, z_norm, M[i])
return d
scale = 1
data = generate_heatmap_data_new(scale)
figure, tax = ternary.figure(scale=scale)
tax.heatmap(data, style="hexagonal", use_rgba=True, colorbar=False)
tax.clear_matplotlib_ticks()
tax.get_axes().axis('off')
tax.boundary()
tax.set_title("RGBA Heatmap")
plt.show()
I want to show high heat value (may be in red color) when there is high accuracy and low heat value when the accuracy value is less.
I am not able to figure out how to achieve this. Any help will be much appreciated.
Thanks in advance.
Rajat
``
The text was updated successfully, but these errors were encountered:
Hi, apologies for not seeing this until now. You basically want an interpolated heatmap, which the library doesn't directly support. You need to interpolate the values yourself and the use heatmapf to plot the resulting function. See #81 .
Hi team,
Thanks for your work. I am facing some problem with plotting heatmaps.
I have list as shown below:
[ [0.2, 0.4,0.4, 0.90], [0.5, 0.1,0.4, 0.59], [0.3, 0.6,0.1, 0.87] ......, [0.4, 0.3,0.3, 0.95] ]
where the first three indexes are some parameters of my machine learning model and 4th is the accuracy value.
I want to plot triangular heat map, where each point inside the triangle is represented by the first three indexes of my list and each of those points have a heat value of: 4th index in my list.
This is what I tried :
I want to show high heat value (may be in red color) when there is high accuracy and low heat value when the accuracy value is less.
I am not able to figure out how to achieve this. Any help will be much appreciated.
Thanks in advance.
Rajat
``
The text was updated successfully, but these errors were encountered: