Python Forum
Seaborn heatmap intervals
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Seaborn heatmap intervals
#1
Hi all,
Im creating a heatmap using seaborn in python, and I want to set the intervals between the minimum value and maximum value to be 0.05.
right now, my problem is that there are some lines that showing all blue and not showing differences because their values are to low.
but the comparision should be between the same row and not to the other rows that Im checking.
this is my code:
with open('heat1.csv', 'r', encoding='mac_roman', newline='') as csvfile:
    df = pd.read_csv(csvfile, sep=',')
    df['id'] = df['id'].apply(lambda x: x[:-2])
    df = df.fillna(0)   
    grpby = df.groupby('id', as_index=True).mean()
    normalized = preprocessing.normalize(grpby)
    vmin1 = normalized.min(axis=0)
    vmax1 = normalized.max(axis=0)
    # print(vmax1)
    plt.subplots(figsize = (250,100))
    sns.set(font_scale=7.5)
    sns.heatmap(normalized, cmap='coolwarm', vmin = 0 , vmax=0.6, linewidths=0.2, robust=True)  
    plt.ylabel('')
    plt.show()
and right now this is an examle of the heatmap Im getting:
https://ibb.co/nPh2Ygf

I tried to use the vmin1 and vmax1 variables to define the vmax and vmin of the map to be the values of each row, but I got a value error.
Any help is appreciated, thanks!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  K means clustering using heatmap Rifscape 0 4,205 Sep-10-2017, 11:08 PM
Last Post: Rifscape

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020