HoliInn
HoliInn

Reputation: 189

How to add coordinate axises in between subplots

enter image description here

I've generated this grid of grids with the following code:

x1, y1 = np.meshgrid(np.linspace(-5,5,10),np.linspace(-5,5,10))

fig, ax = plt.subplots(len(x1), len(y1))

for i in range(len(x1)):
    for j in range(len(y1)):
        x2, y2 = np.meshgrid(np.linspace(-5, 5, 10), np.linspace(-5, 5, 10))

        grads, costs = get_grad_mesh(x1[i][j], y1[i][j])
        _, _, u, v = get_lists_from_list_of_vecs(grads)


        ax[i][j].quiver(x2,y2,u,v,costs, linewidth=4)

        # ax[i][j].set_title(f"x1: {round(x1[i][j], 2)}, y1: {round(y1[i][j], 2)}")

        ax[i][j].get_xaxis().set_visible(False)
        ax[i][j].get_yaxis().set_visible(False)

I want to insert a thick line between the subplots, right in the vertical and horizontal midpoints. How do I do that?

Upvotes: 0

Views: 22

Answers (1)

Davide_sd
Davide_sd

Reputation: 13135

Try playing with these properties:

ax[i][j].spines['top'].set_linewidth(1.5)
ax[i][j].spines['bottom'].set_linewidth(1.5)
ax[i][j].spines['left'].set_linewidth(1.5)
ax[i][j].spines['right'].set_linewidth(1.5)

Upvotes: 1

Related Questions