2015-12-11 12 views
16

海底ヒートマップのドキュメントには、 thisヒートマップがあります。海底ヒートマップy軸逆順

今、y軸は下端が9で始まり、上端が0で終わります。 これを回す方法はありますか?つまり、下端が0で始まり、上端が9で終わりますか?

答えて

20

ax.invert_yaxis()のように見えます。

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() 

を与える: enter image description here

-1

私がいたようにあなたは、あなたがこれを行うことができ、ヒートマップのための「進」jointplot()を使用している場合は、数字を持っているから、例えば、以下の

import matplotlib.pyplot as plt 
import numpy 
import seaborn 

x = numpy.arange(10) 
y = x**2 

g = seaborn.jointplot(x, y, kind='hex') 
g.fig.axes[0].invert_yaxis() 

plt.show() 

enter image description here

関連する問題