在Python中将子图连接到单个图中

时间:2019-10-22 00:57:17

标签: python python-3.x numpy matplotlib

因此,我具有当前函数,该函数给了我一个带有一个圆并在给定圆的中心处有一个点的图:

def epicentral_distance(station, differential_time_variable, Vp = 5.5, Vs = 3.2):
    ri = differential_time_variable*(1/Vs - 1/Vp)**(-1)
    print( np.round(ri,3) )
    return np.round(ri,3)


def station_earthquake_GraphFunction(station,differential_time_variable, Vp = 5.5, Vs = 3.2):
    radius = epicentral_distance(station, differential_time_variable, Vp = 5.5, Vs = 3.2)
    fig, ax = plt.subplots(figsize = (5,5))

    graph_station = plt.plot(station[0],station[1],'^r')
    graph_circle = plt.Circle(station, radius, color = 'r',fill = False)

    ax.add_artist(graph_circle)
    plt.xticks(np.arange(-100,100,20))
    plt.yticks(np.arange(-100,100,20))
    return graph_station, graph_circle

我正在尝试使用以下值运行该函数:

station_earthquake_GraphFunction((10,10), 3.922)
station_earthquake_GraphFunction((15,45),3.272)
station_earthquake_GraphFunction((60,30),3.874)

这里有两个问题:

  1. 每次运行函数时,都会得到一个单独的图。我想多次运行该函数,并将结果绘制在单个图形上。我该怎么办?

  2. 运行此功能3次后,我将在给定点有3个相交的圆。如何确定交点的x和y值?

0 个答案:

没有答案