[英]Line graph with multiple axes matplotlib
Is it possible to have a below given like plot with Python matplotlib ? 是否可以使用Python matplotlib在下面给出类似图? one axis and multiple lines I know how to plot.
我知道如何绘制一条轴和多条线。 But can we have one plot with
2 x axes
and 2 y axes
for same line graph. 但是,对于同一条线图,我们能否有一个具有
2 x axes
和2 y axes
的图。
Data input format: Particular count at particular time in a particular lat and lon. 数据输入格式:特定时间在特定纬度和经度中的特定计数。
[0] [1] [2] [3]
3123 12:00:01 73.789561 19.997404
5342 12:15:00 73.780732 19.994279
4515 12:15:30 73.785531 19.994191
4515 12:00:20 73.786610 19.993679
6265 12:10:10 73.784650 19.997702
col[0] int count
col[1] time interval
col[2] longitude
col[3] latitude
X1 = col[0]
y1 = col[1]
x2 = col[3]
y2 = col[2]
How can I have all the 4 axes in one line plot. 如何在一条线图中绘制所有4个轴。
You can use ax.twinx()
and ax.twiny()
to accomplish what you are after. 您可以使用
ax.twinx()
和ax.twiny()
完成您想要做的事情。 Take a look at this example , it should get you on the right path. 看一下这个例子 ,它应该使您走上正确的道路。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.