首页 > 解决方案 > 抑制 RainCloudplot 中未使用的区域 - Python

问题描述

我正在使用 PtitPrince 和 Seaborn 在 Python 上绘制 RainClouds,并且我的数据中有“间隙”(时间序列,事件不会发生),我想抑制它。

我的图是这样的:

数字

但我希望它没有蓝色块,因为在这些时间不会发生任何事件:

我的脚本:

dx = "ThreatType"; dy = "InTrialHitTime"; dhue = "Collection_Group"; ort = "h"; pal = "husl"; sigma = .1
ax=pt.RainCloud(x = dx, y = dy, data = df, palette = pal, bw = sigma,
                 width_viol = .7, figsize = (12,7), orient = ort, alpha= .40, dodge = True, pointplot = True)
ax.set_yticklabels(['High Shock', 'Low Shock'])
ax.set_xlabel('Devil hit time')

标签: pythonseaborn

解决方案


推荐阅读