[英]How to add box plots on top of scatter plot
I would look into using matplotlib.我会考虑使用 matplotlib。 Boxes can be drawn as such: https://matplotlib.org/gallery/pyplots/boxplot_demo_pyplot.html?highlight=boxplot and scatter plots can also be drawn as such: https://matplotlib.org/gallery/lines_bars_and_markers/scatter_demo2.html?highlight=scatter
框可以这样绘制: https : //matplotlib.org/gallery/pyplots/boxplot_demo_pyplot.html? highlight =boxplot ,散点图也可以这样绘制: https : //matplotlib.org/gallery/lines_bars_and_markers/scatter_demo2。 html?highlight=scatter
There is a search functionality on their site, along with plenty of documentation on how to utilize their library.他们的网站上有一个搜索功能,以及关于如何使用他们的图书馆的大量文档。
As for your specific question, you can specify zorder when drawing many of the things in matplotlib, and you could use that to define your boxplots to be on top.至于你的具体问题,你可以在 matplotlib 中绘制许多东西时指定 zorder,你可以使用它来定义你的箱线图在上面。 I believe if no zorder is defined that it draws items in the order they are encountered in your program (so you could draw scatter plots and then box plots and they should appear correctly as in your diagram above!
我相信如果没有定义 zorder ,它会按照它们在您的程序中遇到的顺序绘制项目(因此您可以绘制散点图,然后绘制箱线图,它们应该像上面的图表一样正确显示!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.