有什么方法可以从海洋小提琴图中获取迷你箱形图吗? [英] Is there any way to get just the mini boxplot from a seaborn violinplot?

查看:83
本文介绍了有什么方法可以从海洋小提琴图中获取迷你箱形图吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试绘制一系列很长的箱线图.我喜欢在 violinplot (通过内部"参数添加到seaborn.violinplot).有谁知道一种简单的方法来绘制此迷你箱形图,而没有其余的小提琴图?谢谢!

I'm trying to draw a very long series of boxplots. I like the aesthetic of the miniature boxplots drawn inside violinplot (controlled via the "inner" parameter to seaborn.violinplot). Does anyone know of an easy way to draw just this mini boxplot without the rest of the violinplot? Thanks!

推荐答案

我能够创建完成我想要的操作的violinplot子类.基本上,我只是复制了绘制贴图的代码,并删除了不需要的部分.这显然有点丑陋,但确实做到了.如果其他人提出了更优雅的解决方案,请发表您的答案.

I was able to create a subclass of violinplot that does what I want. Basically I just copied the code that draws the voilins and deleted the parts I didn't need. This is obviously a little ugly but it did the job. If anyone else comes up with a more elegant solution please post your answer.

您可以在以下位置找到我的解决方案: https://gist.github.com/mdbecker/c21e6a8a6ce893b61eecd880d9f18a83

You can find my solution at: https://gist.github.com/mdbecker/c21e6a8a6ce893b61eecd880d9f18a83

哪个会产生如下结果:

这篇关于有什么方法可以从海洋小提琴图中获取迷你箱形图吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆