Seaborn一维热图开关x和y轴

时间:2018-08-13 13:07:16

标签: python seaborn heatmap

是否可以在Seaborn 1D热图中切换--- apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: vs spec: hosts: - "*" gateways: - gateway http: - match: - uri: prefix: "/kibana" route: - destination: port: number: 5601 host: kibana - match: - uri: prefix: "/grafana" route: - destination: port: number: 3000 host: grafana ` -和x轴? 实际图如下:

Actual Heatmap

我对此图的代码如下:

y

因此,最后,#Histogram data n1, bins1, patches1 = plt.hist(x_start, bins=binwidth, cumulative=False, normed=1, facecolor='#023d6b', alpha=0.8, histtype='bar',label='density random') n2, bins2, patches2 = plt.hist(histo, bins=binwidth, cumulative=False, normed=1, facecolor='red', alpha=0.5, histtype='bar',label='density real') df = pd.DataFrame({'Departure real': n2,'Departure model':n1}, index= bins2[:-1]+1) #Plot Options fig2, ax2 =plt.subplots(figsize=(16,11)) ax2=sns.heatmap(df, annot=False, fmt="g",cmap="seismic",cbar_kws={'label': 'Probability'}) ax2.figure.axes[-1].yaxis.label.set_size(16) ax2.set_ylabel('Hours [h]', fontsize=16) ax2.xaxis.set_tick_params(labelsize=16) ax2.yaxis.set_tick_params(labelsize=16) ax2.invert_yaxis() cax = plt.gcf().axes[-1] cax.tick_params(labelsize=16) 应该在Hours [h]轴上,xDeparture model应该在Departure real轴上。到目前为止,我找不到任何解决方案。如果有另一种方法可以更好地做到这一点,我就不必使用Seaborn。

0 个答案:

没有答案