I have velocity values ranging from 0 to 4000 (m/year) and I would like a colormap like the one in the photo example, but with everything under 1000 being black. Any idea on how to do that? I have been trying with center
but without success. The code I use is:
# Plot Hovmoller diagram
# turn the axis label
df_velocity = df_velocity.sort_index()
df_velocity2 = df_velocity.fillna(0) # I replace all my nans by zeros otherwise there are too many holes in my plot
plt.figure(figsize=(15,15))
ax = sns.heatmap(df_velocity2,vmin=0, vmax=4000)#,center=1000)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.