Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Python Seaborn Heatmap Turnoff main plot keep the cbar [duplicate]

$
0
0

I am drawing a sub-plot figures with each sub-plot is a heatmap. I turned off all cbars. Now I will plot cbar separately. While doing so, I am getting main plot. I don't want it. I want to turn if off.

My code:

df1 = Datetime        2022-08-04 15:06:00     53.4    57.82022-08-04 15:07:00     54.3    57.02022-08-04 15:08:00     53.7    57.02022-08-04 15:09:00     54.3    57.22022-08-04 15:10:00     55.4    57.52023-10-21 14:00:00     43.9    35.22023-10-21 14:01:00     43.4    34.82023-10-21 14:02:00     43.4    34.72023-10-21 14:03:00     43.3    34.52023-10-21 14:04:00     42.7    33.9# Heatmap: draw colorbar only, turn off the plotsns.heatmap(np.reshape(df1.dropna().values.flatten(),(-1,1)),cbar=True,cmap='jet')plt.show()

Present output:

enter image description here

Expected output:

enter image description here


Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>