在matplotlib中,如何在图的两侧显示轴? [英] In matplotlib, how do you display an axis on both sides of the figure?

查看:187
本文介绍了在matplotlib中,如何在图的两侧显示轴?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用matplotlib在图的两边绘制一个带有轴的图,与此图相似(颜色与此问题无关):

< img src =https://i.stack.imgur.com/gHYKk.gifalt =plot>



我如何用 matplotlib



注意:与示例图中显示的相反,我希望两个轴完全相同,并且只想显示一张图。在线文档中有几个相关的示例: 解决方案




I want to draw a plot with matplotlib with axis on both sides of the plot, similar to this plot (the color is irrelevant to this question):

How can I do this with matplotlib?

Note: contrary to what is shown in the example graph, I want the two axis to be exactly the same, and want to show only one graph. Adding the two axis is only to make reading the graph easier.

解决方案

There are a couple of relevant examples in the online documentation:

这篇关于在matplotlib中,如何在图的两侧显示轴?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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