matplotlib 中的背靠背直方图
Matlab 有一个很好的函数可以绘制背对背直方图。我需要在 matplotlib 中创建一个类似的图表。谁能展示一个有效的代码示例?
There is a nice function that draws back to back histograms in Matlab. I need to create a similar graph in matplotlib. Can anyone show a working code example?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
感谢 Mark Rushakoff 指出的链接,以下是我最终所做的
Thanks to the link pointed by Mark Rushakoff, following is what I finally did
这个 matplotlib 用户邮件帖子 有一些示例向上和向下而不是向左和向右移动的双直方图的代码。 这是他链接到的示例输出。
如果上下绝对不适合您,那么只需几分钟即可将 y 轴操作与 x 轴操作交换。
另外,您的链接不是 MATLAB 函数,而是某人编写的大约 40 行的实际脚本。您实际上可以查看脚本源并尝试移植它,因为 MATLAB 和 matplotlib 具有相当接近的语法。
This matplotlib users mailing post has some sample code for a bihistogram that goes up and down instead of left and right. Here's the example output he linked to.
If up-down absolutely won't work for you, it should only take a few minutes to swap the operations on the y-axis with the x-axis operations.
Also, your link isn't a MATLAB function, it's an actual script that someone wrote in about 40 lines. You could actually look at the script source and try porting it, since MATLAB and matplotlib have fairly close syntax.