Have a look at this heatmap found in the seaborn heatmap documentation.
Right now the y-axis starts with 9 at the bottom, and ends with 0 on top. Is there a way to turn this around, i.e. start with 0 at bottom and end with 9 at the top?
The value of Y-axis in a seaborn heatmap is reversed when home icon or H button is pushed.
Use tick_params() for changing the appearance of ticks and tick labels. Use left=false and bottom=false to remove the tick marks.
heatmap() fmt parameter – add text on each cell. fmt: Pass value as a string, optional.
Looks like ax.invert_yaxis()
solves it.
Following the example from which you got the figure:
import numpy as np; np.random.seed(0) import seaborn as sns; sns.set() uniform_data = np.random.rand(10, 12) ax = sns.heatmap(uniform_data) ax.invert_yaxis()
Gives:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With